So I am trying to load multiple csv files into a project and figured I could use one array, say data_in, for all my csv files so I can reference them with say
data_in[,,1] ##first csv file
data_in[1,,2] ## first row of second csv file
And so on. To read the files I have this loop.
for (i in seq_along(names)) {
file_name <- paste(names[i],".csv", sep = "")
data_in[,,i] <- read.csv(file_name, header=T, sep= ",")
}
But obviously I wouldn't be here if it worked. I'm not used to R so do I need to declare the dimensions of data_in before I load in data? Is there a way to read the data in by only using index for the csv file or do I have to use a 3D array? Sorry if this is sort of basic.
Any help is much appreciated. Have a nice day.