Re: [R] Merging multiple .csv files into one dataframe

2021-06-09 Thread Jeff Newmiller
Attachments have been stripped by the mailing list. Read the Posting Guide. Also, English can help, but R code can be ever so much more clear in indicating what you have to work with and even what you want out of the broken/missing part of your code.

Re: [R] Merging multiple .csv files into one dataframe

2021-06-09 Thread Bert Gunter
I really think you need to create a simple reprex to show us what you want to do. In doing so, you may figure out how to get what you want. I suspect you may also need to spend some more time learning R -- following rote examples can be a fool's errand if you don't know the basics. Bert Gunter

Re: [R] merging multiple .csv files

2020-12-15 Thread PIKAL Petr
r-help mailing list > Subject: Re: [R] merging multiple .csv files > > I know that but I do not want to merge them sequentially because I may lose > some rows which are present in one file while the other doesn't have. I > googled and found something called multmerge but the code i

Re: [R] merging multiple .csv files

2020-12-15 Thread Spencer Graves
Did you work the examples in help("merge")? Also, have you looked at the "dplyr" package? It has 9 different vignettes. The lead author is Hadley Wickham, who won the 2019 COPSS Presidents' Award for work like this. Alternatively, you could manually read all 10 files, then figure

Re: [R] merging multiple .csv files

2020-12-15 Thread pooja sinha
I know that but I do not want to merge them sequentially because I may lose some rows which are present in one file while the other doesn't have. I googled and found something called multmerge but the code is not working for me. I used the following: path <-"P:/Documents/Puja Desktop

Re: [R] merging multiple .csv files

2020-12-15 Thread Bert Gunter
?read.csv to read your csv files in data frames ?merge to merge them (sequentially). Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Tue, Dec 15, 2020 at 1:36

Re: [R] Merging multiple .csv files

2012-04-11 Thread R. Michael Weylandt
Simply pass all = FALSE to merge_all merge_all(list_of_files, by = Name, all = FALSE) Michael On Wed, Apr 11, 2012 at 1:09 AM, Chintanu chint...@gmail.com wrote: Thanks to David and Michael Michael: That works, however with a glitch. Each of my 24 files has got two columns: Name, and

Re: [R] Merging multiple .csv files

2012-04-11 Thread Chintanu
Thanks again. By the way, any idea why I get this error: merged3 - merge_all(list_of_files , by = Name) Error in `[.data.frame`(df, , match(names(dfs[[1]]), names(df))) : undefined columns selected sessionInfo() R version 2.14.2 (2012-02-29) Platform: i386-pc-mingw32/i386 (32-bit) locale:

Re: [R] Merging multiple .csv files

2012-04-10 Thread R. Michael Weylandt
Your problem is that you can't merge the file names, but you need to load them into R and merge the resulting objects. This should be straightforward enough to do: file_list - list.files() list_of_files - lapply(file_list, read.csv) # Read in each file merge_all(list_of_files, by = Name)

Re: [R] Merging multiple .csv files

2012-04-10 Thread David Winsemius
On Apr 11, 2012, at 12:17 AM, R. Michael Weylandt wrote: Your problem is that you can't merge the file names, but you need to load them into R and merge the resulting objects. This should be straightforward enough to do: file_list - list.files() list_of_files - lapply(file_list, read.csv) #

Re: [R] Merging multiple .csv files

2012-04-10 Thread Chintanu
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: