Hi,

I have many files containing one column of data. I like to use the scan
function to parse the data. Next I like to bind to a large vector.
I try this like:

count<-1
files <- list.files()  # all files in the working directory
for(i in files) {

       tmp <- scan(i)
       assign(files[count], tmp)
      count<-count+1
}

This part works!

Now I like to plot the data in a boxplot.

Usually I do this from individual vectors like:

comb <- data.frame(dat = c(vector1, vector2 ......), ind = c(rep('vector1',
length(vector1)).......))
boxplot(dat ~ ind, data = comb)

But how do I do this i a loop?

I know the vector names (according to the filenames in the working
directory), but I do not how to access them in my R code after having
assigned the names.

I guess the "lapply" or "dply" from the plyr library can do this, but I seem
not to be able to do it.

Is there a way to do this?

gma

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to