I have used the 'dropLayer' function from the Raster package before, but not recently. I have just updated R (to 2.15.1) and I believe some of my packages have updated in this process, and maybe that's the problem?

I keep getting the following error when using 'dropLayer':

> HI11.7911<-brick("HI11.nc")
> HI11.8611<-dropLayer(HI11.7911,c(1:7))
Error in names(st@z) <- nc$var[[zvar]]$dim[[dim3]]$units[bands] : 
  'names' attribute [26] must be the same length as the vector [0]

HI11.7911 has 33 layers, and I am trying to drop the first 7 layers to create HI11.8611. I wasn't totally sure of the correct syntax, but I've tried the following and all receive the same error:

> HI11.8611<-dropLayer(HI11.7911,1:7)
Error in names(st@z) <- nc$var[[zvar]]$dim[[dim3]]$units[bands] : 
  'names' attribute [26] must be the same length as the vector [0]
> HI11.8611<-dropLayer(HI11.7911,c(1,2,3,4,5,6,7))
Error in names(st@z) <- nc$var[[zvar]]$dim[[dim3]]$units[bands] : 
  'names' attribute [26] must be the same length as the vector [0]

Thanks,
Tiffany
	[[alternative HTML version deleted]]

