Re: [R] create vectors within a double loop

2009-05-23 Thread Nikos Alexandris
jim holtman: > You might want to look at how to use 'lapply' to create lists. Here > is one way of doing it: > > > # create test data > > a_threshold <- b_threshold <- as.data.frame(matrix(sample(c(1:5, > NA), 100, TRUE), 10)) > > classification <- c('a', 'b') > > result <- lapply(classificatio

Re: [R] create vectors within a double loop

2009-05-23 Thread jim holtman
You might want to look at how to use 'lapply' to create lists. Here is one way of doing it: > # create test data > a_threshold <- b_threshold <- as.data.frame(matrix(sample(c(1:5, NA), 100, TRUE), 10)) > classification <- c('a', 'b') > result <- lapply(classification, function(.cls){ + colSum

[R] create vectors within a double loop

2009-05-23 Thread Nikos Alexandris
Hi R-list. This is my first post. I'll try to be as precise as possible with the difficulty I have to "get things done". I have a hard time trying to construct a double "for" loop and create within the inner loop new objects (in this case vectors). I posted this question in a non-directly relate