Skip to content
Prev 71 / 29559 Next

numeric(0) ?????

Dear Massimiliano


How about

for (i in 1:20){
if(any(T$pluto==i)) T$pippo[T$pluto==i]
}

??

Depending on what you want to do with these subsets of the data.frame, 
you might want to consider using
``tapply'' or ``by'' [se the help-files for these functions] instead of 
the for loop.

For example :

tapply(T$pluto,T$pippo, sum)

Cheers

Ole
Massimiliano Cannata wrote: