Hello.
I'm trying to work my way through creating the bioclim variables using the
biovars function.
raster version 1.7-23 (4-January-2010)
dismo version 0.5-11

Long story short, has anyone had luck running dismo's biovars using
rasterStacks in the builds mentioned above? Now, details of my particular
problems:

my input variables are each 12 layer stacks for tmin, tmax, prec, for
example:

tmin
class       : RasterStack
dimensions  : 1121, 657, 12  (nrow, ncol, nlayers)
ncell       : 736497
resolution  : 1080, 1080  (x, y)
projection  : +proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0
+y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs +towgs84=0,0,0
extent      : -2356170, -1646610, 1242060, 2452740  (xmin, xmax, ymin, ymax)
min values  : -15.6 -16.3 -15.3 -13.6  -9.2  -4.6  -1.7  -2.1  -5.1  -8.6
...
max values  : 11 12 13 16 21 26 30 29 26 20 ...

Using biovars as

bioclim.1971.2000 <- biovars(prec,tmin,tmax)

I get:

Error in checkSlotAssignment(object, name, value) :
  assignment of an object of class "numeric" is not valid for slot "nlayers"
in an object of class "MultipleRasterData"; is(value, "integer") is not TRUE

Popping into Robert's code on R-forge, I see the following

...

out <- brick(raster(prec))
           out@data@nlayers <- 19

When I try these commands outside his code I get the same error. For some
reason not recognizing that 19 is an integer. A run-around fix forcing an
integer '19' into out@data@nlayers gets me past this glitch, but then on to
another. So now I'm asking for help.

Long story short, has anyone had luck running dismo's biovars using
rasterStacks in the builds mentioned above?
Is there something I'm missing? The function works fine when I use vectors
for prec, tmin, and tmax. I have NAs in my data, is this a problem? Doesn't
explain the nlayers difficulty, though. Is there an incompatibility in
package builds that I'm overlooking? I really would prefer to use my
exisiting rasters instead of turning them all into vectors.

Many thanks in advance, especially if this ends up being a no-brainer.

Meg

-- 
------------------------------------------------
Meg Krawchuk, Ph.D.
Post-doctoral Research Fellow
Department of Environmental Science, Policy and Management
335 Mulford Hall
University of California, Berkeley
office phone: 510.642.9499

web: http://nature.berkeley.edu/~megk/ <http://nature.berkeley.edu/%7Emegk/>

mailing address:
130 Mulford  Hall MC #3114
University of California, Berkeley
Berkeley, California 94720
U.S.A.

	[[alternative HTML version deleted]]

