0

I have six different files and they all have the same columns and there are more than 1,000,000 rows of combined data. I want to transfer all these rows into a single R variable.

Can I do it? Can you actually import data from several files into a R variable

SS_11
  • 53
  • 3
  • 7
  • 1
    Please read [**how to make a great reproducible example**](http://stackoverflow.com/q/5963269/1478381) and update your question accordingly. – Simon O'Hanlon Aug 21 '13 at 12:53

1 Answers1

2

Yes, yes you can. R is very versatile like that.

#  Get files
fls <- list.files( path = "C:/path/to/files/" , full.names = TRUE )

#  Read them in. Each is a list element
inTabs <- lapply( fls , read.table , h = TRUE , sep = "\t" )

#  Bind each together into a single data.frame
out <- do.call( rbind , inTabs )
Simon O'Hanlon
  • 58,647
  • 14
  • 142
  • 184