Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201945

Merging multiple text files into one dataframe [duplicate]

$
0
0

I have this reproducible set up.

temp <- tempfile()
download.file("https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip",temp)
datafiles <- unzip(temp)
unlink(temp)

Printing datafiles gives a range of txt files. I can manually merge them by...

mdataset = merge(mydata1.txt, mydata2.txt)
mdataset = merge(mydataset, mydata3.txt)
.
.
.
mytempdata = merge(mytempdata, mydata20.txt)

But this would take a while, and I would rather do it more efficiently.

How would I do this (elegantly)?


Viewing all articles
Browse latest Browse all 201945

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>