Skip to content
Prev 305120 / 398506 Next

qplot with many files (each one curve)

Jonas Stein <news <at> jonasstein.de> writes:
I would use something along the lines of

L <- lapply(list.files(pattern),read.csv)

  to read the files into a list.

Something like

L2 <- mapply(function(i,x) {
    data.frame(file=i,x) },seq_along(L),L)

to add an index column to each data frame

L3 <- do.call(rbind,L2)

to combine them all into a single data frame

and

ggplot(L3,aes(x=x,y=y,group=file))+geom_line()