{"id":192116,"date":"2023-06-20T09:40:10","date_gmt":"2023-06-20T13:40:10","guid":{"rendered":"https:\/\/ibkrcampus.com\/?p=192116"},"modified":"2023-06-20T09:40:54","modified_gmt":"2023-06-20T13:40:54","slug":"10-r-functions-for-linux-commands-and-vice-versa","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/10-r-functions-for-linux-commands-and-vice-versa\/","title":{"rendered":"10 R Functions for Linux Commands and Vice-versa"},"content":{"rendered":"\n<p>This post will go through 10 different Linux commands and their&nbsp;<a href=\"https:\/\/theautomatic.net\/category\/r\/\">R<\/a>&nbsp;alternatives. If you\u2019re interested in learning more R functions for working with files like some of those below,&nbsp;<a href=\"https:\/\/theautomatic.net\/2018\/07\/11\/manipulate-files-r\/\">also check out this post<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-how-to-list-all-the-files-in-a-directory\"><strong>How to list all the files in a directory<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Linux<\/th><th>R<\/th><th>What does it do?<\/th><\/tr><tr><td>ls<\/td><td>list.files()<\/td><td>Lists all the files in a directory<\/td><\/tr><tr><td>ls -R<\/td><td>list.files(recursive = TRUE)<\/td><td>Recursively lists all the files in a directory and all sub-directories<\/td><\/tr><tr><td>ls | grep \u201csomething\u201d<\/td><td>list.files(pattern = \u201csomething\u201d)<\/td><td>Lists all the files in a directory containing the regex \u201csomething\u201d<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong><em>R<\/em><\/strong><\/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=\"\">list.files(\"\/path\/to\/directory\")\n \n \nlist.files(\"\/path\/to\/do\/directory\", recursive = TRUE)\n \n \n# search for files containing \"something\" in their name\nlist.files(\"\/path\/to\/do\/directory\", pattern = \"something\")\n \n \n# search for all CSV files\nlist.files(\"\/path\/to\/do\/directory\", pattern = \".csv\")<\/pre>\n\n\n\n<p><strong><em>Linux<\/em><\/strong><\/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=\"\">ls \/path\/to\/directory\n \n \nls -R \/path\/to\/directory\n \n \n# search for files containing \"something\" in their name\nls \/path\/to\/directory | grep \"something\"\n \n \n# search for all CSV files\nls \/path\/to\/directory | grep \".csv\"<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Getting the top records in a file \/ object<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Linux<\/th><th>R<\/th><th>What does it do?<\/th><\/tr><tr><td>head<\/td><td>head()<\/td><td>Prints the top n records of a file (Linux) \/ data frame or other object (R)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong><em>R<\/em><\/strong><\/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=\"\"># let df be a data frame\nhead(df)\n \nhead(df, 10)<\/pre>\n\n\n\n<p><strong><em>Linux<\/em><\/strong><\/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=\"\">head -6 some_file.txt\n \nhead -10 some_file.txt<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Getting the current directory<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Linux<\/th><th>R<\/th><th>What does it do?<\/th><\/tr><tr><td>pwd<\/td><td>getwd()<\/td><td>Gets the current directory<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong><em>R<\/em><\/strong><\/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=\"\">getwd()<\/pre>\n\n\n\n<p><strong><em>Linux<\/em><\/strong><\/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=\"\">pwd<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Changing the directory<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Linux<\/th><th>R<\/th><th>What does it do?<\/th><\/tr><tr><td>cd<\/td><td>setwd()<\/td><td>Change the current working directory<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong><em>R<\/em><\/strong><\/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=\"\">setwd(\"\/path\/to\/new\/directory\")<\/pre>\n\n\n\n<p><strong><em>Linux<\/em><\/strong><\/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=\"\">cd \/path\/to\/new\/directory<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to count the number of files in a directory<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Linux<\/th><th>R<\/th><th>What does it do?<\/th><\/tr><tr><td>ls -1 | wc -l<\/td><td>length(list.files(\u2026))<\/td><td>Counts the number of files in a directory<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong><em>R<\/em><\/strong><\/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=\"\">length(list.files(\"\/path\/to\/some\/directory\"))<\/pre>\n\n\n\n<p><strong><em>Linux<\/em><\/strong><\/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=\"\">ls -1 | wc -l<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to check file permissions<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Linux<\/th><th>R<\/th><th>What does it do?<\/th><\/tr><tr><td>ls -l<\/td><td>file.info()<\/td><td>Returns the file permissions (Linux) \/ additional info (R)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong><em>R<\/em><\/strong><\/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=\"\">file.info(\"\/path\/to\/directory\/file.txt\")<\/pre>\n\n\n\n<p><strong>file.info<\/strong>&nbsp;returns additional information about a file besides file permissions, including size, created time, last modified time, and last access time. If you just want to get permissions of the file, just run 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=\"\">file.info(\"\/path\/to\/directory\/file.txt\")$mode<\/pre>\n\n\n\n<p>The permissions are returned in octal; to translate what this octal result means into read \/ write etc. abilities,&nbsp;<a href=\"https:\/\/permissions-calculator.org\/decode\/\">see this link<\/a>.<\/p>\n\n\n\n<p><strong><em>Linux<\/em><\/strong><\/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=\"\">ls -l \/path\/to\/directory\/file.txt<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to create a new directory<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Linux<\/th><th>R<\/th><th>What does it do?<\/th><\/tr><tr><td>mkdir<\/td><td>dir.create()<\/td><td>Creates a new directory<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong><em>R<\/em><\/strong><\/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=\"\"># create folder in current directory\ndir.create(\"new_folder\")\n \n# create folder in different directory\ndir.create(\"\/path\/to\/new_directory\")<\/pre>\n\n\n\n<p><strong><em>Linux<\/em><\/strong><\/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=\"\"># create folder in current directory\nmkdir new_folder\n \n# create folder in different directory\nmkdir \/path\/to\/new_directory<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to create a new file<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Linux<\/th><th>R<\/th><th>What does it do?<\/th><\/tr><tr><td>touch<\/td><td>file.create()<\/td><td>Creates a new file<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong><em>R<\/em><\/strong><\/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=\"\"># create a file in current directory\nfile.create(\"new_file.txt\")\n \n# create file in different directory\nfile.create(\"\/path\/to\/directory\/new_file.txt\")<\/pre>\n\n\n\n<p><strong><em>Linux<\/em><\/strong><\/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=\"\"># create a file in current directory\ntouch new_file.txt\n \n# create file in different directory\ntouch \/path\/to\/directory\/new_file.txt<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to count the number of lines, words, and characters in a file<\/strong><\/h2>\n\n\n\n<p>Though it\u2019s possible to get the number of lines, words, and characters in a file using base R, it\u2019s simpler to do so with the&nbsp;<strong>hyperSpec<\/strong>&nbsp;package.<\/p>\n\n\n\n<p>Just use&nbsp;<strong>install.packages<\/strong>&nbsp;to install if needed:<\/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=\"\">install.packages(\"hyperSpec\")<\/pre>\n\n\n\n<p>Running the below line of code will print out a data frame with the number of characters, words, and lines in the input file. Similarly, the Linux&nbsp;<strong>wc<\/strong>&nbsp;command will print out the same information for a file.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Linux<\/th><th>R<\/th><th>What does it do?<\/th><\/tr><tr><td>wc<\/td><td>wc()<\/td><td>Lists the number of characters, words, and lines in a file<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong><em>R<\/em><\/strong><\/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=\"\">library(hyperSpec)\n \nwc(\"\/path\/to\/directory\/file.txt\")<\/pre>\n\n\n\n<p><strong><em>Linux<\/em><\/strong><\/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=\"\">wc \/path\/to\/directory\/file.txt<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to copy a file<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Linux<\/th><th>R<\/th><th>What does it do?<\/th><\/tr><tr><td>cp<\/td><td>file.copy()<\/td><td>Copy a file<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong><em>R<\/em><\/strong><\/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=\"\"># copy file.txt to new_directory\nfile.copy(\"\/path\/to\/directory\/file.txt\", \"\/path\/to\/new_directory\")<\/pre>\n\n\n\n<p><strong><em>Linux<\/em><\/strong><\/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=\"\"># option 1\ncp \/path\/to\/directory\/file.txt \/path\/to\/new_directory\n \n# option 2\ncp \/path\/to\/directory\/file.txt \/path\/to\/new_directory\/file.txt<\/pre>\n\n\n\n<p><em>Originally posted on <a href=\"https:\/\/theautomatic.net\/2018\/12\/10\/10-r-functions-for-linux-commands-and-vice-versa\/\">TheAutomatic.net<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post will go through 10 different Linux commands and their\u00a0R\u00a0alternatives.<\/p>\n","protected":false},"author":388,"featured_media":186467,"comment_status":"open","ping_status":"closed","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[339,343,338,341,342],"tags":[806,5041,487],"contributors-categories":[13695],"class_list":{"0":"post-192116","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-quant-development","11":"category-r-development","12":"tag-data-science","13":"tag-linux","14":"tag-r","15":"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.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>10 R Functions for Linux Commands and Vice-versa<\/title>\n<meta name=\"description\" content=\"This post will go through 10 different Linux commands and their\u00a0R\u00a0alternatives.\" \/>\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\/192116\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"10 R Functions for Linux Commands and Vice-versa | IBKR Campus US\" \/>\n<meta property=\"og:description\" content=\"This post will go through 10 different Linux commands and their\u00a0R\u00a0alternatives.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/10-r-functions-for-linux-commands-and-vice-versa\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-20T13:40:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-20T13:40:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/03\/r-programing.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"900\" \/>\n\t<meta property=\"og:image:height\" content=\"550\" \/>\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=\"3 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\\\/10-r-functions-for-linux-commands-and-vice-versa\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/10-r-functions-for-linux-commands-and-vice-versa\\\/\"\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\": \"10 R Functions for Linux Commands and Vice-versa\",\n\t            \"datePublished\": \"2023-06-20T13:40:10+00:00\",\n\t            \"dateModified\": \"2023-06-20T13:40:54+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/10-r-functions-for-linux-commands-and-vice-versa\\\/\"\n\t            },\n\t            \"wordCount\": 473,\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\\\/10-r-functions-for-linux-commands-and-vice-versa\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/03\\\/r-programing.jpg\",\n\t            \"keywords\": [\n\t                \"Data Science\",\n\t                \"Linux\",\n\t                \"R\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"Data Science\",\n\t                \"Programming Languages\",\n\t                \"Quant\",\n\t                \"Quant Development\",\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\\\/10-r-functions-for-linux-commands-and-vice-versa\\\/#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\\\/10-r-functions-for-linux-commands-and-vice-versa\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/10-r-functions-for-linux-commands-and-vice-versa\\\/\",\n\t            \"name\": \"10 R Functions for Linux Commands and Vice-versa | 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\\\/10-r-functions-for-linux-commands-and-vice-versa\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/10-r-functions-for-linux-commands-and-vice-versa\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/03\\\/r-programing.jpg\",\n\t            \"datePublished\": \"2023-06-20T13:40:10+00:00\",\n\t            \"dateModified\": \"2023-06-20T13:40:54+00:00\",\n\t            \"description\": \"This post will go through 10 different Linux commands and their\u00a0R\u00a0alternatives.\",\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\\\/10-r-functions-for-linux-commands-and-vice-versa\\\/\"\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\\\/10-r-functions-for-linux-commands-and-vice-versa\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/03\\\/r-programing.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/03\\\/r-programing.jpg\",\n\t            \"width\": 900,\n\t            \"height\": 550,\n\t            \"caption\": \"R Programming\"\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":"10 R Functions for Linux Commands and Vice-versa","description":"This post will go through 10 different Linux commands and their\u00a0R\u00a0alternatives.","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\/192116\/","og_locale":"en_US","og_type":"article","og_title":"10 R Functions for Linux Commands and Vice-versa | IBKR Campus US","og_description":"This post will go through 10 different Linux commands and their\u00a0R\u00a0alternatives.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/10-r-functions-for-linux-commands-and-vice-versa\/","og_site_name":"IBKR Campus US","article_published_time":"2023-06-20T13:40:10+00:00","article_modified_time":"2023-06-20T13:40:54+00:00","og_image":[{"width":900,"height":550,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/03\/r-programing.jpg","type":"image\/jpeg"}],"author":"Andrew Treadway","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Andrew Treadway","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/10-r-functions-for-linux-commands-and-vice-versa\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/10-r-functions-for-linux-commands-and-vice-versa\/"},"author":{"name":"Andrew Treadway","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/d4018570a16fb867f1c08412fc9c64bc"},"headline":"10 R Functions for Linux Commands and Vice-versa","datePublished":"2023-06-20T13:40:10+00:00","dateModified":"2023-06-20T13:40:54+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/10-r-functions-for-linux-commands-and-vice-versa\/"},"wordCount":473,"commentCount":0,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/10-r-functions-for-linux-commands-and-vice-versa\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/03\/r-programing.jpg","keywords":["Data Science","Linux","R"],"articleSection":["Data Science","Programming Languages","Quant","Quant Development","R Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/10-r-functions-for-linux-commands-and-vice-versa\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/10-r-functions-for-linux-commands-and-vice-versa\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/10-r-functions-for-linux-commands-and-vice-versa\/","name":"10 R Functions for Linux Commands and Vice-versa | IBKR Campus US","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/10-r-functions-for-linux-commands-and-vice-versa\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/10-r-functions-for-linux-commands-and-vice-versa\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/03\/r-programing.jpg","datePublished":"2023-06-20T13:40:10+00:00","dateModified":"2023-06-20T13:40:54+00:00","description":"This post will go through 10 different Linux commands and their\u00a0R\u00a0alternatives.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/10-r-functions-for-linux-commands-and-vice-versa\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/10-r-functions-for-linux-commands-and-vice-versa\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/03\/r-programing.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/03\/r-programing.jpg","width":900,"height":550,"caption":"R Programming"},{"@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\/2023\/03\/r-programing.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/192116","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=192116"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/192116\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/186467"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=192116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=192116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=192116"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=192116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}