I have 30 runs of data, each stored in a separate CSV file, runi.csv, i = 0:29.
Let's say I want to collect them all into a list. Best way I know how to do this is
runs = list()
for (i in 1:30) { runs[[i]] = read.csv(paste("run", i-1, ".csv")); }
Now let's further say that each of these data frames stored in the list has the same column layouts and that I'm interested in the column identified by "x" and the column identified by "y".
What is the easiest way to plot all 30 runs' worth of (x, y) pairs? Here's how I would currently do it (and I feel there must be a better way):
xList = list()
yList = list()
for (i in 1:30) { xList[[i]] = runs[[i]]$x; yList[[i]] = runs[[i]]$y; }
matplot(x=as.data.frame(xList), y=as.data.frame(yList))
This gets even more painful when I'm trying to do transformations to the data; I can't figure out how to apply a function to a specific column of each data frame stored in a list.
Any help here would be extremely helpful.