I am currently having trouble in Rstudio with outputting a new dataset from multiple datasets, and not having them replace each other. I initially had issues with importing multiple datasets and was able to figure that out with
dataFiles <- Sys.glob("*.csv")
However I am having trouble actually running a for loop for these datasets at the same time without changing the actual file.
for example
for (file in dataFiles) {
Data <- read.csv(file, sep = ",", header = T, skip = 2)
}
only outputs the last file that is read, and erases all previous.
Is there a way to change the output name?
Edit: My current issue is that I am not able to save the data in dataFiles, they are all replaced by the last dataset. The coding within the for loop does work.