I am facing a very small issue with R. However, prior research on the forum have not yielded any positive findings.
Specifically, I have a list of authors and their publications, as well as further administrative data relating to their publications. The unique column matching the administrative data to their publication is found in the 2nd column of both datasets.
As such I have written the following code below to match each author's unique administrative data to their publications:
for (file in file_list) {
XX <- read.csv(paste(file,"_Dets.csv",sep=""))
YY <- read.csv(paste(file,"_Cits.csv",sep=""))
file <- merge(XX, YY, by = 2:2, all = F)
}
Unfortunately, instead of producing N number of outputs, I find that "file", in this case, is repeatedly overwritten in each loop. How do I fix this?
I am using the latest version of R on a Mac.
The file_list looks like this:
[1] "Weils_Raymond"
[2] "Lucas_George"
...
[30] "Clinton_Peel"