{"id":104,"date":"2013-03-17T19:45:02","date_gmt":"2013-03-18T00:45:02","guid":{"rendered":"http:\/\/homepages.uc.edu\/~yaozo\/wordpress\/?p=104"},"modified":"2013-03-17T19:45:02","modified_gmt":"2013-03-18T00:45:02","slug":"read-multiple-csv-files-into-separate-data-frames","status":"publish","type":"post","link":"https:\/\/zhuoyao.net\/index.php\/2013\/03\/17\/read-multiple-csv-files-into-separate-data-frames\/","title":{"rendered":"Read multiple CSV files into separate data frames"},"content":{"rendered":"<p><code>##Read files named xyz1111.csv, xyz2222.csv, etc. <\/code><\/p>\n<address><code>filenames &lt;- list.files(path=\"..\/Data\/original_data\", pattern=\"xyz+.*csv\") <\/code><\/address>\n<p><code>##Create list of data frame names without the \".csv\" part <\/code><\/p>\n<address><code>names &lt;-substr(filenames,1,7)) <\/code><\/address>\n<p><code>###Load all files <\/code><\/p>\n<address><code>for(i in names){ filepath &lt;- file.path(\"..\/Data\/original_data\/\",paste(i,\".csv\",sep=\"\")) assign(i, read.delim(filepath, colClasses=c(\"character\",\"factor\",rep(\"numeric\",4)), sep = \"\\t\")) }<\/code><\/address>\n","protected":false},"excerpt":{"rendered":"<p>##Read files named xyz1111.csv, xyz2222.csv, etc. filenames &lt;- list.files(path=&#8221;..\/Data\/original_data&#8221;, pattern=&#8221;xyz+.*csv&#8221;) ##Create list of data frame names without the &#8220;.csv&#8221; part names &lt;-substr(filenames,1,7)) ###Load all files&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-104","post","type-post","status-publish","format-standard","hentry","category-r"],"_links":{"self":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts\/104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/comments?post=104"}],"version-history":[{"count":0,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts\/104\/revisions"}],"wp:attachment":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/media?parent=104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/categories?post=104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/tags?post=104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}