[Biomod-commits] Extracting values from a raster

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


  Thank you very much Wilfried.

That works.

Best,

Manuel

On 09/09/2010 05:28 a.m., Wilfried Thuiller wrote:
> Few tips:
>
> 1- Make sure you really load the raster. You might need to put the 
> complete path to the raster in the raster call.
> for instance, plot the raster.
>
> muestra = raster("cld6190_ann.asc")
> plot(muestra)
>
> 2- Put your data in the C folder. There are free space in your path 
> and I gather spanish signs.
> Make sure to put the data at the root with no space in the same and 
> without any particular signs.
>
>
>
> Le 9 sept. 10 à 13:21, Manuel Spínola a écrit :
>
>> 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
>
> -------------------------
> 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/d6c8bb42/attachment-0001.htm>


More information about the Biomod-commits mailing list