[R] Change class of elements in list

2012-12-26 Thread Robin Corrià
Dear R users, I have a list of objects of type "im" > mylist$sp1 $sp2 $sp3 and I want to convert them to a list of objects of class "SpatialGridDataFrame" This works for a single object of class "im": a <- mylist$sp1 b <- as(a, "SpatialGridDataFrame") Then I want to write each element in the ne

[R] Multiple selection, renaming and saving the results

2011-11-25 Thread Robin Corrià
Dear all, I have a big data frame: str(data1) 'data.frame': 18272 obs. of 11 variables: $ tag : int 11 12 13 15 17 18 19 100011 100012 100014 ... $ sp : Factor w/ 18 levels "acassp","acocar",..: 13 5 7 14 14 18 3 11 13 10 ... $ gx : num 20 10 35 68