[Biomod-commits] Extracting values from a raster

Manuel Spínola mspinola10 at gmail.com
Thu Sep 9 13:21:51 CEST 2010


  Thank you very much Wilfried,

However,

df = xyValues(muestra, loca)
Error en .local(.Object, ...) :
   `C:/Documents and Settings/Manuel/Mis documentos/Manolo/Proyectos en 
R/Análisis Espacial/cld6190_ann.asc' does not exist in the file system,
and is not recognised as a supported dataset name.


Best,

Manuel


On 08/09/2010 10:53 p.m., Wilfried Thuiller wrote:
> 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 <mailto: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 
> <mailto:wilfried.thuiller at ujf-grenoble.fr>
> Home page: http://www.will.chez-alice.fr <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 
> <http://www.macis-project.net/>
> FP6 European EcoChange project: http://www.ecochange-project.eu 
> <http://www.ecochange-project.eu/>
>
>
>
>
>


-- 
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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/biomod-commits/attachments/20100909/9e008ebd/attachment.htm>


More information about the Biomod-commits mailing list