Re: [R] Change class of elements in list

2012-12-26 Thread David Winsemius
On Dec 26, 2012, at 4:44 AM, Robin CorriĆ  wrote: 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, "SpatialGridD

[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