{"id":189180,"date":"2023-04-24T11:40:26","date_gmt":"2023-04-24T15:40:26","guid":{"rendered":"https:\/\/ibkrcampus.com\/?p=189180"},"modified":"2023-04-24T11:40:25","modified_gmt":"2023-04-24T15:40:25","slug":"dont-forget-the-utils-package-in-r","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/dont-forget-the-utils-package-in-r\/","title":{"rendered":"Don\u2019t Forget the \u201cutils\u201d Package in R"},"content":{"rendered":"\n<p>With thousands of powerful packages, it\u2019s easy to glaze over the libraries that come preinstalled with&nbsp;<a href=\"https:\/\/theautomatic.net\/category\/r\/\">R<\/a>. Thus, this post will talk about some of the cool functions in the&nbsp;<strong>utils<\/strong>&nbsp;package, which comes with a standard installation of R. While&nbsp;<strong>utils<\/strong>&nbsp;comes with several familiar functions, like&nbsp;<em>read.csv<\/em>,&nbsp;<em>write.csv<\/em>, and&nbsp;<em>help<\/em>, it also contains over 200 other functions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-readclipboard-and-writeclipboard\"><strong>readClipboard and writeClipboard<\/strong><\/h2>\n\n\n\n<p>One of my favorite duo of functions from&nbsp;<strong>utils<\/strong>&nbsp;is&nbsp;<em>readCLipboard<\/em>&nbsp;and&nbsp;<em>writeClipboard<\/em>. If you\u2019re doing some manipulation to get a quick answer between R and Excel, these functions can come in handy.&nbsp;<em>readClipboard<\/em>&nbsp;reads in whatever is currently on the Clipboard.<\/p>\n\n\n\n<p>For example, let\u2019s copy a column of cells from Excel.<\/p>\n\n\n\n<p>We can now run&nbsp;<em>readClipboard()<\/em>&nbsp;in R. The result of running this command is a vector containing the column of cells we just copied. Each cell corresponds to an element in the vector.<\/p>\n\n\n\n<p>R<br>is<br>really<br>awesome<\/p>\n\n\n\n<p>We can now run&nbsp;<em>readClipboard()<\/em>&nbsp;in R. The result of running this command is a vector containing the column of cells we just copied. Each cell corresponds to an element in the vector.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"460\" height=\"51\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/04\/readClipboard-result-in-R-TheAutomatic.net_.jpg\" alt=\"\" class=\"wp-image-189189 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/04\/readClipboard-result-in-R-TheAutomatic.net_.jpg 460w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/04\/readClipboard-result-in-R-TheAutomatic.net_-300x33.jpg 300w\" data-sizes=\"(max-width: 460px) 100vw, 460px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 460px; aspect-ratio: 460\/51;\" \/><\/figure>\n\n\n\n<p>Similarly, if we want to write a vector of elements to the clipboard, we can the&nbsp;<em>writeClipboard<\/em>&nbsp;command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">test &lt;- c(\"write\", \"to\", \"clipboard\")\n \nwriteClipboard(test)<\/pre>\n\n\n\n<p>Now, the vector&nbsp;<strong>test<\/strong>&nbsp;has been copied to the clipboard. If you paste the result in Excel, you\u2019ll see a column of cells corresponding to the vector you just copied.<\/p>\n\n\n\n<p>write<br>to<br>clipboard<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>combn<\/strong><\/h2>\n\n\n\n<p>The&nbsp;<em>combn<\/em>&nbsp;function is useful for getting the possible combinations of an input vector. For instance, let\u2019s say we want to get all of the possible 2-element combinations of a vector, we could do this:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">food &lt;- c(\"apple\", \"grape\", \"orange\", \"pear\", \"peach\", \"banana\")\n \ncombn(food, 2)<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"640\" height=\"133\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/04\/combn-get-all-combinations-of-a-vector-in-r-TheAutomatic.net_.jpg\" alt=\"\" class=\"wp-image-189191 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/04\/combn-get-all-combinations-of-a-vector-in-r-TheAutomatic.net_.jpg 640w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/04\/combn-get-all-combinations-of-a-vector-in-r-TheAutomatic.net_-300x62.jpg 300w\" data-sizes=\"(max-width: 640px) 100vw, 640px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 640px; aspect-ratio: 640\/133;\" \/><\/figure>\n\n\n\n<p>In general, the first parameter of&nbsp;<em>combn<\/em>&nbsp;is the vector of elements you want to get possible combinations from. The second parameter is the number of elements you want in each combination. So if you need to get all possible 3-element or 4-element combinations, you would just need to change this number to three or four.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">combn(food, 3)\n \ncombn(food, 4)\n\n<\/pre>\n\n\n\n<p>We can also add a parameter called&nbsp;<strong>simplify<\/strong>&nbsp;to make the function return a list of each combination, rather than giving back a matrix output like above.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">combn(food, 3, simplify = FALSE)<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>FileSnapshot<\/strong><\/h2>\n\n\n\n<p>The&nbsp;<em>fileSnapshot<\/em>&nbsp;function is one R\u2019s collection of file manipulation functions. To learn more about file manipulation and getting information on files in R,&nbsp;<a href=\"https:\/\/theautomatic.net\/2018\/07\/11\/manipulate-files-r\/\">check out this post<\/a>.<\/p>\n\n\n\n<p><em>fileSnapshot<\/em>&nbsp;will list and provide details about the files in a directory. This function returns a list of objects.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># get file snapshot of current directory\nsnapshot &lt;- fileSnapshot()\n \n# or file snapshot of another directory\nsnapshot &lt;- fileSnapshot(\"C:\/some\/other\/directory\")<\/pre>\n\n\n\n<p>fileSnapshot returns a list, which here we will just call \u201csnapshot\u201d. The most useful piece of information can be garnered from this by referencing \u201cinfo\u201d:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">snapshot$info<\/pre>\n\n\n\n<p>Here, snapshot$info is a data frame showing information about the files in the input folder parameter. Its headers include:<\/p>\n\n\n\n<p>-size ==&gt; size of file<br>-isdir ==&gt; is file a directory? ==&gt; TRUE or FALSE<br>-mode ==&gt; the file permissions in octal<br>-mtime ==&gt; last modified time stamp<br>-ctime ==&gt; time stamp created<br>-atime ==&gt; time stamp last accessed<br>-exe ==&gt; type of executable (or \u201cno\u201d if not an executable)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>download.file<\/strong><\/h2>\n\n\n\n<p><em>download.file<\/em>&nbsp;does just what it sounds like \u2013 downloads a file from the internet to the destination provided in the function\u2019s input. The first parameter is the URL of the file you wish to download. The second parameter is the name you want to give to the downloaded file. Below, we download a file and call it \u201ccensus_data.csv\u201d.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">download.file(\"https:\/\/www2.census.gov\/programs-surveys\/popest\/datasets\/2010\/2010-eval-estimates\/cc-est2010-alldata.csv\", \"census_data.csv\")<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to modify an object on the fly with the \u201cfix\u201d function<\/strong><\/h2>\n\n\n\n<p>The&nbsp;<strong>utils<\/strong>&nbsp;package also has the ability to modify objects on the fly with the&nbsp;<em>fix<\/em>&nbsp;function. For instance, let\u2019s say you define a function interactively, and you want to make some modification.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">some_func &lt;- function(num)\n{\n    3 * num + 1\n \n}<\/pre>\n\n\n\n<p>Now, let\u2019s modify the function with&nbsp;<em>fix<\/em>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">fix(some_func)<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full img-twothird\"><img decoding=\"async\" width=\"332\" height=\"294\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/04\/fix-function-in-r-TheAutomatic.net_.jpg\" alt=\"\" class=\"wp-image-189192 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/04\/fix-function-in-r-TheAutomatic.net_.jpg 332w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/04\/fix-function-in-r-TheAutomatic.net_-300x266.jpg 300w\" data-sizes=\"(max-width: 332px) 100vw, 332px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 332px; aspect-ratio: 332\/294;\" \/><\/figure>\n\n\n\n<p>When you call&nbsp;<em>fix<\/em>, it comes up with an editor allowing you to modify the definition of the function. You can also call&nbsp;<em>fix<\/em>&nbsp;to modify a vector or data frame.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">fix(iris)<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"640\" height=\"220\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/04\/fix-data-frame-in-r-TheAutomatic.net_.jpg\" alt=\"\" class=\"wp-image-189193 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/04\/fix-data-frame-in-r-TheAutomatic.net_.jpg 640w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/04\/fix-data-frame-in-r-TheAutomatic.net_-300x103.jpg 300w\" data-sizes=\"(max-width: 640px) 100vw, 640px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 640px; aspect-ratio: 640\/220;\" \/><\/figure>\n\n\n\n<p>That\u2019s it for this post! Please check out my other R posts by&nbsp;<a href=\"https:\/\/theautomatic.net\/category\/r\/\">clicking here<\/a>.&nbsp;<\/p>\n\n\n\n<p><em>Originally posted on <a href=\"https:\/\/theautomatic.net\/2019\/04\/03\/dont-forget-the-utils-package-in-r\/\">TheAutomatic.net<\/a> blog.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We can now run readClipboard() in R. The result of running this command is a vector containing the column of cells we just copied.<\/p>\n","protected":false},"author":388,"featured_media":139162,"comment_status":"open","ping_status":"closed","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[339,343,338,342],"tags":[],"contributors-categories":[13695],"class_list":{"0":"post-189180","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-data-science","8":"category-programing-languages","9":"category-ibkr-quant-news","10":"category-r-development","11":"contributors-categories-theautomatic-net"},"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Don\u2019t Forget the \u201cutils\u201d Package in R | IBKR Quant<\/title>\n<meta name=\"description\" content=\"We can now run readClipboard() in R. The result of running this command is a vector containing the column of cells we just copied.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/189180\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Don\u2019t Forget the \u201cutils\u201d Package in R | IBKR Campus US\" \/>\n<meta property=\"og:description\" content=\"We can now run readClipboard() in R. The result of running this command is a vector containing the column of cells we just copied.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/dont-forget-the-utils-package-in-r\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-24T15:40:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/05\/abstract-quant-blue-purple-nodes.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"563\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Andrew Treadway\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andrew Treadway\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\n\t    \"@context\": \"https:\\\/\\\/schema.org\",\n\t    \"@graph\": [\n\t        {\n\t            \"@type\": \"NewsArticle\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/dont-forget-the-utils-package-in-r\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/dont-forget-the-utils-package-in-r\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Andrew Treadway\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/d4018570a16fb867f1c08412fc9c64bc\"\n\t            },\n\t            \"headline\": \"Don\u2019t Forget the \u201cutils\u201d Package in R\",\n\t            \"datePublished\": \"2023-04-24T15:40:26+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/dont-forget-the-utils-package-in-r\\\/\"\n\t            },\n\t            \"wordCount\": 715,\n\t            \"commentCount\": 0,\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/dont-forget-the-utils-package-in-r\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/05\\\/abstract-quant-blue-purple-nodes.jpg\",\n\t            \"articleSection\": [\n\t                \"Data Science\",\n\t                \"Programming Languages\",\n\t                \"Quant\",\n\t                \"R Development\"\n\t            ],\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"CommentAction\",\n\t                    \"name\": \"Comment\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/dont-forget-the-utils-package-in-r\\\/#respond\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/dont-forget-the-utils-package-in-r\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/dont-forget-the-utils-package-in-r\\\/\",\n\t            \"name\": \"Don\u2019t Forget the \u201cutils\u201d Package in R | IBKR Campus US\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\"\n\t            },\n\t            \"primaryImageOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/dont-forget-the-utils-package-in-r\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/dont-forget-the-utils-package-in-r\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/05\\\/abstract-quant-blue-purple-nodes.jpg\",\n\t            \"datePublished\": \"2023-04-24T15:40:26+00:00\",\n\t            \"description\": \"We can now run readClipboard() in R. The result of running this command is a vector containing the column of cells we just copied.\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"ReadAction\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/dont-forget-the-utils-package-in-r\\\/\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"ImageObject\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/dont-forget-the-utils-package-in-r\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/05\\\/abstract-quant-blue-purple-nodes.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/05\\\/abstract-quant-blue-purple-nodes.jpg\",\n\t            \"width\": 1000,\n\t            \"height\": 563,\n\t            \"caption\": \"Quant\"\n\t        },\n\t        {\n\t            \"@type\": \"WebSite\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"name\": \"IBKR Campus US\",\n\t            \"description\": \"Financial Education from Interactive Brokers\",\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"SearchAction\",\n\t                    \"target\": {\n\t                        \"@type\": \"EntryPoint\",\n\t                        \"urlTemplate\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/?s={search_term_string}\"\n\t                    },\n\t                    \"query-input\": {\n\t                        \"@type\": \"PropertyValueSpecification\",\n\t                        \"valueRequired\": true,\n\t                        \"valueName\": \"search_term_string\"\n\t                    }\n\t                }\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"Organization\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\",\n\t            \"name\": \"Interactive Brokers\",\n\t            \"alternateName\": \"IBKR\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"logo\": {\n\t                \"@type\": \"ImageObject\",\n\t                \"inLanguage\": \"en-US\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\",\n\t                \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"width\": 669,\n\t                \"height\": 669,\n\t                \"caption\": \"Interactive Brokers\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\"\n\t            },\n\t            \"publishingPrinciples\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/about-ibkr-campus\\\/\",\n\t            \"ethicsPolicy\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/cyber-security-notice\\\/\"\n\t        },\n\t        {\n\t            \"@type\": \"Person\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/d4018570a16fb867f1c08412fc9c64bc\",\n\t            \"name\": \"Andrew Treadway\",\n\t            \"description\": \"Andrew Treadway currently works as a Senior Data Scientist, and has experience doing analytics, software automation, and ETL. He completed a master\u2019s degree in computer science \\\/ machine learning, and an undergraduate degree in pure mathematics. Connect with him on LinkedIn: https:\\\/\\\/www.linkedin.com\\\/in\\\/andrew-treadway-a3b19b103\\\/In addition to TheAutomatic.net blog, he also teaches in-person courses on Python and R through my NYC meetup: more details.\",\n\t            \"sameAs\": [\n\t                \"https:\\\/\\\/theautomatic.net\\\/about-me\\\/\"\n\t            ],\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/andrewtreadway\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Don\u2019t Forget the \u201cutils\u201d Package in R | IBKR Quant","description":"We can now run readClipboard() in R. The result of running this command is a vector containing the column of cells we just copied.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/189180\/","og_locale":"en_US","og_type":"article","og_title":"Don\u2019t Forget the \u201cutils\u201d Package in R | IBKR Campus US","og_description":"We can now run readClipboard() in R. The result of running this command is a vector containing the column of cells we just copied.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/dont-forget-the-utils-package-in-r\/","og_site_name":"IBKR Campus US","article_published_time":"2023-04-24T15:40:26+00:00","og_image":[{"width":1000,"height":563,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/05\/abstract-quant-blue-purple-nodes.jpg","type":"image\/jpeg"}],"author":"Andrew Treadway","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Andrew Treadway","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/dont-forget-the-utils-package-in-r\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/dont-forget-the-utils-package-in-r\/"},"author":{"name":"Andrew Treadway","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/d4018570a16fb867f1c08412fc9c64bc"},"headline":"Don\u2019t Forget the \u201cutils\u201d Package in R","datePublished":"2023-04-24T15:40:26+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/dont-forget-the-utils-package-in-r\/"},"wordCount":715,"commentCount":0,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/dont-forget-the-utils-package-in-r\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/05\/abstract-quant-blue-purple-nodes.jpg","articleSection":["Data Science","Programming Languages","Quant","R Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/dont-forget-the-utils-package-in-r\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/dont-forget-the-utils-package-in-r\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/dont-forget-the-utils-package-in-r\/","name":"Don\u2019t Forget the \u201cutils\u201d Package in R | IBKR Campus US","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/dont-forget-the-utils-package-in-r\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/dont-forget-the-utils-package-in-r\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/05\/abstract-quant-blue-purple-nodes.jpg","datePublished":"2023-04-24T15:40:26+00:00","description":"We can now run readClipboard() in R. The result of running this command is a vector containing the column of cells we just copied.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/dont-forget-the-utils-package-in-r\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/dont-forget-the-utils-package-in-r\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/05\/abstract-quant-blue-purple-nodes.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/05\/abstract-quant-blue-purple-nodes.jpg","width":1000,"height":563,"caption":"Quant"},{"@type":"WebSite","@id":"https:\/\/ibkrcampus.com\/campus\/#website","url":"https:\/\/ibkrcampus.com\/campus\/","name":"IBKR Campus US","description":"Financial Education from Interactive Brokers","publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ibkrcampus.com\/campus\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ibkrcampus.com\/campus\/#organization","name":"Interactive Brokers","alternateName":"IBKR","url":"https:\/\/ibkrcampus.com\/campus\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","width":669,"height":669,"caption":"Interactive Brokers"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/"},"publishingPrinciples":"https:\/\/www.interactivebrokers.com\/campus\/about-ibkr-campus\/","ethicsPolicy":"https:\/\/www.interactivebrokers.com\/campus\/cyber-security-notice\/"},{"@type":"Person","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/d4018570a16fb867f1c08412fc9c64bc","name":"Andrew Treadway","description":"Andrew Treadway currently works as a Senior Data Scientist, and has experience doing analytics, software automation, and ETL. He completed a master\u2019s degree in computer science \/ machine learning, and an undergraduate degree in pure mathematics. Connect with him on LinkedIn: https:\/\/www.linkedin.com\/in\/andrew-treadway-a3b19b103\/In addition to TheAutomatic.net blog, he also teaches in-person courses on Python and R through my NYC meetup: more details.","sameAs":["https:\/\/theautomatic.net\/about-me\/"],"url":"https:\/\/www.interactivebrokers.com\/campus\/author\/andrewtreadway\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/05\/abstract-quant-blue-purple-nodes.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/189180","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/users\/388"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=189180"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/189180\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/139162"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=189180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=189180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=189180"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=189180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}