{"id":195303,"date":"2023-08-25T09:37:57","date_gmt":"2023-08-25T13:37:57","guid":{"rendered":"https:\/\/ibkrcampus.com\/?p=195303"},"modified":"2023-08-25T13:42:58","modified_gmt":"2023-08-25T17:42:58","slug":"basic-r-read-so-many-csv-files","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basic-r-read-so-many-csv-files\/","title":{"rendered":"Basic R: Read So Many CSV Files"},"content":{"rendered":"\n<p>This post presents basic R code snippets to read files with given file extensions such as csv or txt. This is simple but very useful when it comes to the case where there are too many files to read manually.<\/p>\n\n\n\n<p>If we have too many (i.e. 1000 files) csv files or its variants, it is impossible to read these files one by one manually.<\/p>\n\n\n\n<p>For example, let&#8217;s assume that there are 6 files (USD.CSV, EUR.csv, CNY.TXT, AUD.txt, CNY2.ttxt, USD.CCSV) in a target directory. The first four files (csv, CSV, txt, TXT) are the files that we want to read. The contents of these files are straightforward because the output will show these contents in the later.<\/p>\n\n\n\n<p>In this case, we can use&nbsp;<strong>list.files()<\/strong>&nbsp;R function to get names of these files with some certain file extensions.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-list-files-function\">list.files() function<\/h3>\n\n\n\n<p><strong>list.files()<\/strong>&nbsp;is a built-in R function which returns a list of names of files with a given pattern.<\/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, pattern=\"\\\\.(csv|txt)$\", \n           ignore.case = TRUE, full.names = FALSE)<\/pre>\n\n\n\n<p>In the above R command,&nbsp;&#8220;\\\\.(csv|txt)$&#8221;&nbsp;pattern specifies that 1) it is applied at the end of file name($), 2) multiple file extensions such as csv or txt file ((csv|txt)) are allowed but not for similar extensions such as ccsv or ttxt(\\\\.). csv and CSV or txt and TXT are allowed because case sensitivity is ignored (ignore.case&nbsp;=&nbsp;TRUE).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">R code<\/h3>\n\n\n\n<p>The following R code is easy and self-contained: 1) reads each csv (CSV) or txt (TXT) files and make each data.frame separately and 2) reads and collects them into one 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=\"\">#========================================================#\n# Quantitative ALM, Financial Econometrics &amp; Derivatives \n# ML\/DL using R, Python, Tensorflow by Sang-Heon Lee \n#\n# https:\/\/shleeai.blogspot.com\n#--------------------------------------------------------#\n# Basic R : read all csv files when these are so many\n#========================================================#\n \n    graphics.off()  # clear all graphs\n    rm(list = ls()) # remove all files from your workspace\n    \n    # working directory\n    setwd(\"D:\/SHLEE\/blog\/R\/many_csv\")\n    \n    # directory where csv files are located\n    path&lt;- file.path(getwd())\n \n#-------------------------------------------------------\n# make a list of all file names with csv or txt ext.\n#-------------------------------------------------------\n# $         : end of file name\n# (csv|txt) : multiple file extentions\n# \\\\.       : avoid unwanted cases such as .ccsv\n#-------------------------------------------------------\n    v.filename &lt;- list.files(\n        path, pattern=\"\\\\.(csv|txt)$\", \n        ignore.case = TRUE, \n        full.names = FALSE)\n \n#-------------------------------------------------------\n# Test 1) read and make each data.frame\n#-------------------------------------------------------\n    for(fn in v.filename) {\n        \n        df.each &lt;- read.csv(fn)\n        \n        # to do with df.each \n        \n        # print\n        print(fn); print(df.each)\n        \n        # use of assign()\n        #\n        # save each file as each data.frame\n        # which has each file name\n        assign(fn, read.csv(fn))\n    }\n \n#-------------------------------------------------------\n# Test 2) read and collect into one data.frame\n#-------------------------------------------------------\n    df.all &lt;- do.call(\n        rbind, lapply(v.filename, \n                      function(x) read.csv(x)))\n    print(df.all)\n    \n    # use of vroom package\n    library(vroom)\n    df.all.vroom &lt;- vroom(v.filename)\n    print(df.all.vroom)<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Output<\/h3>\n\n\n\n<p>We can find that only 4 files with correct file extensions are read while 2 unwanted files (.CCSV and .ttxt) are ignored.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"947\" height=\"580\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/output-SHLeeAIFinancialModel.png\" alt=\"\" class=\"wp-image-195305 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/output-SHLeeAIFinancialModel.png 947w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/output-SHLeeAIFinancialModel-700x429.png 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/output-SHLeeAIFinancialModel-300x184.png 300w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/output-SHLeeAIFinancialModel-768x470.png 768w\" data-sizes=\"(max-width: 947px) 100vw, 947px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 947px; aspect-ratio: 947\/580;\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Additional Output &#8211; assign() function<\/h3>\n\n\n\n<p>Josep Pueyo-Ros kindly advised me to use assign() function to save as a different data.frame with the name of the file. I think it is very useful so I add this function to R code and get the following 4 data.frames which can be seen at&nbsp;<strong>Environment\/Data explorer<\/strong>&nbsp;in R studio.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>USD.CSV<\/li>\n\n\n\n<li>EUR.csv<\/li>\n\n\n\n<li>CNY.TXT<\/li>\n\n\n\n<li>AUD.txt<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Additional Output &#8211; vroom package<\/h3>\n\n\n\n<p>HP (kind blog visitor) suggests the use of&nbsp;<strong>vroom<\/strong>&nbsp;which is a recently developed R package designed specifically for speed. I think this has lots of merits such as fast speed and suitability for complicated task. Result from vroom() function is as follows.<\/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=\"\">> df.all.vroom &lt;- vroom(v.filename)\nRows: 14 Columns: 3                  \n-- Column specification ------------------- \nDelimiter: \",\"\nchr (2): currency, maturity\ndbl (1): ws\n \ni&lt;U+00A0>Use spec()\n(\n)\n to retrieve the full column specification for this data.\ni&lt;U+00A0>Specify the column types or set `show_col_types = FALSE` to quiet this message.\n \n> print(df.all.vroom)\n# A tibble: 14 x 3\n   currency maturity         ws\n   &lt;chr>    &lt;chr>         &lt;dbl>\n 1 AUD      6m        213000000\n 2 AUD      2y        106000000\n 3 AUD      2y        214000000\n 4 CNY      6m         84000000\n 5 CNY      6m         42000000\n 6 CNY      6m        144000000\n 7 EUR      3m       1785000000\n 8 EUR      6m        200000000\n 9 EUR      1y        250000000\n10 EUR      1y       1855000000\n11 USD      3m        285000000\n12 USD      3m        456000000\n13 USD      1y        112000000\n14 USD      2y         56000000\n> <\/pre>\n\n\n\n<p>This R code is efficient and useful especially when there are too many files to read.<\/p>\n\n\n\n<p><em>Originally posted on <a href=\"https:\/\/shleeai.blogspot.com\/2021\/09\/basic-r-read-so-many-csv-files.html\">SHLee AI Financial Model<\/a> blog.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post presents basic R code snippets to read files with given file extensions such as csv or txt.<\/p>\n","protected":false},"author":662,"featured_media":195313,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[339,343,338,341,342],"tags":[806,487,6591,15868],"contributors-categories":[13728],"class_list":{"0":"post-195303","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-r","14":"tag-rstats","15":"tag-vroom-package","16":"contributors-categories-sh-fintech-modeling"},"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>Basic R: Read So Many CSV Files | IBKR Quant<\/title>\n<meta name=\"description\" content=\"This post presents basic R code snippets to read files with given file extensions such as csv or txt.\" \/>\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\/195303\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Basic R: Read So Many CSV Files | IBKR Campus US\" \/>\n<meta property=\"og:description\" content=\"This post presents basic R code snippets to read files with given file extensions such as csv or txt.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basic-r-read-so-many-csv-files\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-25T13:37:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-25T17:42:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/r-programming-sample-code-light-blue.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=\"Sang-Heon Lee\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sang-Heon Lee\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 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\\\/basic-r-read-so-many-csv-files\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/basic-r-read-so-many-csv-files\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Sang-Heon Lee\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/0a959ff9de7f0465a07baa1fe1ae0200\"\n\t            },\n\t            \"headline\": \"Basic R: Read So Many CSV Files\",\n\t            \"datePublished\": \"2023-08-25T13:37:57+00:00\",\n\t            \"dateModified\": \"2023-08-25T17:42:58+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/basic-r-read-so-many-csv-files\\\/\"\n\t            },\n\t            \"wordCount\": 434,\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\\\/basic-r-read-so-many-csv-files\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/08\\\/r-programming-sample-code-light-blue.jpg\",\n\t            \"keywords\": [\n\t                \"Data Science\",\n\t                \"R\",\n\t                \"rstats\",\n\t                \"vroom package\"\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\\\/basic-r-read-so-many-csv-files\\\/#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\\\/basic-r-read-so-many-csv-files\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/basic-r-read-so-many-csv-files\\\/\",\n\t            \"name\": \"Basic R: Read So Many CSV Files | 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\\\/basic-r-read-so-many-csv-files\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/basic-r-read-so-many-csv-files\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/08\\\/r-programming-sample-code-light-blue.jpg\",\n\t            \"datePublished\": \"2023-08-25T13:37:57+00:00\",\n\t            \"dateModified\": \"2023-08-25T17:42:58+00:00\",\n\t            \"description\": \"This post presents basic R code snippets to read files with given file extensions such as csv or txt.\",\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\\\/basic-r-read-so-many-csv-files\\\/\"\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\\\/basic-r-read-so-many-csv-files\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/08\\\/r-programming-sample-code-light-blue.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/08\\\/r-programming-sample-code-light-blue.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\\\/0a959ff9de7f0465a07baa1fe1ae0200\",\n\t            \"name\": \"Sang-Heon Lee\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/sang-heonlee\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Basic R: Read So Many CSV Files | IBKR Quant","description":"This post presents basic R code snippets to read files with given file extensions such as csv or txt.","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\/195303\/","og_locale":"en_US","og_type":"article","og_title":"Basic R: Read So Many CSV Files | IBKR Campus US","og_description":"This post presents basic R code snippets to read files with given file extensions such as csv or txt.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basic-r-read-so-many-csv-files\/","og_site_name":"IBKR Campus US","article_published_time":"2023-08-25T13:37:57+00:00","article_modified_time":"2023-08-25T17:42:58+00:00","og_image":[{"width":1000,"height":563,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/r-programming-sample-code-light-blue.jpg","type":"image\/jpeg"}],"author":"Sang-Heon Lee","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Sang-Heon Lee","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basic-r-read-so-many-csv-files\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basic-r-read-so-many-csv-files\/"},"author":{"name":"Sang-Heon Lee","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/0a959ff9de7f0465a07baa1fe1ae0200"},"headline":"Basic R: Read So Many CSV Files","datePublished":"2023-08-25T13:37:57+00:00","dateModified":"2023-08-25T17:42:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basic-r-read-so-many-csv-files\/"},"wordCount":434,"commentCount":0,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basic-r-read-so-many-csv-files\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/r-programming-sample-code-light-blue.jpg","keywords":["Data Science","R","rstats","vroom package"],"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\/basic-r-read-so-many-csv-files\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basic-r-read-so-many-csv-files\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basic-r-read-so-many-csv-files\/","name":"Basic R: Read So Many CSV Files | IBKR Campus US","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basic-r-read-so-many-csv-files\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basic-r-read-so-many-csv-files\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/r-programming-sample-code-light-blue.jpg","datePublished":"2023-08-25T13:37:57+00:00","dateModified":"2023-08-25T17:42:58+00:00","description":"This post presents basic R code snippets to read files with given file extensions such as csv or txt.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basic-r-read-so-many-csv-files\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/basic-r-read-so-many-csv-files\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/r-programming-sample-code-light-blue.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/r-programming-sample-code-light-blue.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\/0a959ff9de7f0465a07baa1fe1ae0200","name":"Sang-Heon Lee","url":"https:\/\/www.interactivebrokers.com\/campus\/author\/sang-heonlee\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/r-programming-sample-code-light-blue.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/195303","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\/662"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=195303"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/195303\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/195313"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=195303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=195303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=195303"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=195303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}