Error with function kfold in package dismo
Manuel,
This looks like a bug in 'raster' that I think I have fixed in version
1.5-13 (should be available on R-Forge in 24 hrs or so).
As a work around, you can save ascii files to binary (once):
predictores <- writeRaster(predictores, 'predictores.grd' )
# or
predictores <- writeRaster(predictores, 'predictores.tif' )
and then in the script use:
predictores <- brick('predictores.grd')
# or
predictores <- brick('predictores.tif')
This also has the advantage of being much faster.
Robert
On Sat, Oct 2, 2010 at 3:11 PM, Manuel Sp?nola <mspinola10 at gmail.com> wrote:
?Dear list members, I got this error in package "dismo". fold <- kfold(bradypus, k=5)
bradytrain <- bradypus[fold != 1, ] me <- maxent(predictores, bradytrain)
Error en .readRowsAscii(raster, rows[i], 1) : elemento 1 esta vacio; ?la parte de la lista de argumentos ?'>' ha sido evaluada: ? (startcol, 1) Function maxent works perfect for "bradypus" (data frame with 116 observations), but it doesn't work for "bradytrain" when I use kfold function. "bradytrain" is also a data frame but with 93 observations. ?The message is in Sapnish, but basically say that element 1 is empty. ?Thank you very much in advance. ?Best, Manuel -- Manuel Sp?nola, Ph.D. Instituto Internacional en Conservaci?n y Manejo de Vida Silvestre Universidad Nacional Apartado 1350-3000 Heredia COSTA RICA mspinola at una.ac.cr mspinola10 at gmail.com Tel?fono: (506) 2277-3598 Fax: (506) 2237-7036
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo