[Biomod-commits] Extracting values from a raster
Wilfried Thuiller
wilfried.thuiller at ujf-grenoble.fr
Thu Sep 9 06:53:04 CEST 2010
Because you need to use the raster function to load the raster and not the readAsciiGrid.
muestra = raster("cld6190_ann.asc")
loc = read.csv(file="bradypus.csv",head=TRUE,sep=",")
loca = loc[,2:3]
df = xyValues(muestra, loca)
The xyValues function works with raster object only
Le 9 sept. 2010 à 05:13, Manuel Spínola a écrit :
> Dear list members,
>
> I am trying to use xyValues to extract values from a raster file:
>
> muestra = readAsciiGrid("cld6190_ann.asc")
>
> loc = read.csv(file="bradypus.csv",head=TRUE,sep=",")
> loca = loc[,2:3]
>
> df = xyValues(muestra, loca)
> Error en function (classes, fdef, mtable) :
> unable to find an inherited method for function "xyValues", for signature "SpatialGridDataFrame", "data.frame"
>
> Why did I get the error message?
>
> 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
>
> _______________________________________________
> Biomod-commits mailing list
> Biomod-commits at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/biomod-commits
--------------------------
Dr. Wilfried Thuiller
Laboratoire d'Ecologie Alpine, UMR CNRS 5553
Université Joseph Fourier
BP53, 38041 Grenoble cedex 9, France
tel: +33 (0)4 76 51 44 97
fax: +33 (0)4 76 51 42 79
Email: wilfried.thuiller at ujf-grenoble.fr
Home page: http://www.will.chez-alice.fr
Website: http://www-leca.ujf-grenoble.fr/equipes/tde.htm
FP6 European MACIS project: http://www.macis-project.net
FP6 European EcoChange project: http://www.ecochange-project.eu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/biomod-commits/attachments/20100909/457095e7/attachment.htm>
More information about the Biomod-commits
mailing list