loops - How to read multiple files in R -


I would like to create a loop to read the file I tried paste0 , but it does not work I am going to do the above order in Kashmir = 1 to Kashmir = 10 files

  {for (in 1:29) {exprs.file & lt; - paste0 ("LRRadjustedextremes0.5kgchr", k, ".txt") eset & lt; - read.eset (exprs .file = "/ home / proj / mT_nellore / r / eBrowser / adjust / exprs.file")}}  

cheers

An efficient approach is to generate a vector with file names, and it should be lapply :

< Pre> read the files with the links listed <1> path>

If you have a file inside a folder and want to read them all, then it also works:

Paths & lt; - '/ home / proj / MT_Nellore / R / eBrowser / adjust /' files & lt; - list.files (path = path, pattern = '.txt') Additionally, if your files are too large to fit in memory then consider loading one and the entror to load at a time needed. Only your information is required:
  files & lt; - list.files (path = path, pattern = '.txt') data & lt; - lapply (x = files, function = function file) {tmp < - read.eset Returns (tmp $ xpr)})  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -