Gah - I was mixed up with SpatialPointsDataFrame. My suggestion should have been this:
monthly.sp <- monthly.sp[,,-1] Thanks Jaime, I didn't know there was 3 index extract methods for SGDF. Cheers, Mike. On Tue, Aug 10, 2010 at 6:24 PM, Jaime R. Garcia Marquez <jaime.gar...@uni-bonn.de> wrote: > I think with 'SpatialGridDataFrames' you should do > > monthly.sp <- monthly.sp[,,-1] > > Note the two commas in the index[]. > First index rows, second columns, and third variables. > > HTH > > On Tue, 10 Aug 2010 16:28:18 +1000 > Michael Sumner <mdsum...@gmail.com> wrote: >> >> Do you mean "layer" as in the first column in the data.frame? >> >> Does this do what you want? The negative index means "everything but >> these indexes". >> >> monthly.sp <- monthly.sp[,-1] >> >> >> >> On Tue, Aug 10, 2010 at 12:40 PM, Andy Bunn <andy.b...@wwu.edu> wrote: >>> >>> I have a SpatialGridDataFrame with 325 variables in the @ data slot. I >>> want to drop the first layer. Seems simple enough. Any help? Thanks, Andy >>> >>>> str(monthly.sp) >>> >>> Formal class 'SpatialGridDataFrame' [package "sp"] with 6 slots >>> ..@ data :'data.frame': 8060 obs. of 325 variables: >>> .. ..$ values: num [1:8060] 127.5 31.9 127.5 127.5 231.1 ... >>> .. ..$ values: num [1:8060] 127.5 31.9 127.5 127.5 231.1 ... >>> .. and so on >>> >>> _______________________________________________ >>> R-sig-Geo mailing list >>> R-sig-Geo@stat.math.ethz.ch >>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo >>> >> >> >> >> -- >> Michael Sumner >> Institute for Marine and Antarctic Studies, University of Tasmania >> Hobart, Australia >> e-mail: mdsum...@gmail.com >> >> _______________________________________________ >> R-sig-Geo mailing list >> R-sig-Geo@stat.math.ethz.ch >> https://stat.ethz.ch/mailman/listinfo/r-sig-geo > > > > -- Michael Sumner Institute for Marine and Antarctic Studies, University of Tasmania Hobart, Australia e-mail: mdsum...@gmail.com _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo