[R] Merging multiple .csv files into one dataframe

Esthi Erickson er|ck@one@th| @end|ng |rom gm@||@com
Wed Jun 9 22:28:13 CEST 2021


I am trying to merge columns from four different .csv files into one
dataframe. I am trying to do something like this
https://statisticsglobe.com/merge-csv-files-in-r . I am taking long format
.csv files, 1 being the base file (testing-long.csv) which I change to wide
format first and the three others being supplemental files that should add
columns plight, plightLitter, Root Biomass, NO3Soil, NH4Soil and then add
data to cells where the it matches any one of the values for columns,
"Exp", "Year", "Field", "Plot", "NTrt", "NAdd", "NitrAdd", "NAtm.NAdd". So
the values for the supplemental files need not match every single one of
the columns listed above and if the value does not match all the columns
exactly the cell for that column/row should not be filled. When I try the
method from that website, I do not see the supplemental columns being
added. I am wondering if there is a better way to merge multiple .csv
files. I hope this makes sense, but it is quite confusing even to me, so I
am more than happy to clarify. I am attaching the files in question.

More information about the R-help mailing list