0

I'm quite new to R. I have a folder that has about 400 datasets in .dat format. I would like to import them from the folder into saparated dataframes saving their original names. Inside files look as following:

x1 x2 x3 x4 x5 x6 x7
3.34494983360861 -10.1551377245439 2.04729104928113 5.04839249647869 -4.81433102683924 2.70989181766111 -1.30457769064068
5.52064961416553 -12.3016190492607 0.101398882838427 -0.605507111814781 -2.96478714163403 7.62147991519767 -3.00260061456239

Thank you.

Vlad117
  • 125
  • 1
  • 6
  • 4
    The best method in R is to read them into a list. See [this link](http://stackoverflow.com/questions/11218498/reading-multiple-files-into-multiple-data-frames-in-r) for some tips and this one for [working with lists of data.frames](http://stackoverflow.com/questions/17499013/how-do-i-make-a-list-of-data-frames/24376207#24376207). – lmo Jun 04 '16 at 11:24

1 Answers1

0

It should not be too hard, see here to know the steps for listing all the files in the input directory.

Then, just create data frames as you require. Additionally, you can look here for reading dat files.

Community
  • 1
  • 1
novice
  • 800
  • 2
  • 11
  • 25