Thanks to David and Michael

Michael:

That works, however with a glitch. Each of my 24 files has got two columns:
"Name", and "Rank/score".

file_list <- list.files()
list_of_files <- lapply(file_list, read.csv) # Read in each file

# I can see the 2-columns at this stage. However, the following line:

merge_all(list_of_files, by = "Name")

# produces some NAs for the 2nd column (except the beginning 1/3rd of the
columns which have values). Not sure about the reason - the original files
don't have  any NAs.


Further, I understand that it gives the union of (rows of) files based on
"Name". Is there a way to look for intersection, i.e., similar to using:
merge (.... ,by="Name", all=FALSE)  ?


David:  It came up with an error :

do.call(merge, list_of_files, by="Name")

Error in do.call(merge, list_of_files, by = "Name") :
  unused argument(s) (by = "Name")

Cheers,
Chintanu

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to