Thanks Alex and Mathieu for your replies. I am familiar with the new
packages related to the old adehabitat.

Finally, I solved my problem using rgdal and SDMTools packages as the
following way:

Veg <- readGDAL("~/Desktop/natur_inter.asc")
Veg2=raster(Veg)
blaK <- asc.from.raster(Veg2)
write.asc(blaK, "~/Desktop/NEW_natur_inter.asc", gz=FALSE)





On Sun, Jul 7, 2013 at 10:45 AM, Mathieu Basille <
basille.web@ase-research.org> wrote:

> Dear Andres,
>
> In addition to Alexandre's answers, did you try with the RGDAL package?
> Something like:
>
> veg <- readGDAL("~/Desktop/natur_**inter.asc")
>
> This should solve your problem: the asc should be imported as a
> SpatialPixel object, which can then be used in the new version of
> adehabitat package, as underlined by Alexandre.
>
> Mathieu Basille.
>
>
> Le 07/07/2013 12:46 AM, Alexandre Villers a écrit :
>
>  Hello,
>>
>> Look at adehabitatHS package (and other related packages adehabitatHR and
>> adehabitatLT): there are new functions to take advantage of sp class
>> objects (such as the ones created when reading a raster with rgdal).
>> Adehabitat is now "deprecated" and you should use these other packages
>> instead
>>
>> HTH
>>
>> Alex
>>
>>
>> 2013/7/7 Andres Merino-Viteri <amerinoviteri@gmail.com>
>>
>>  Dear list,
>>>
>>> Sometimes I have problems opening ASCII files  with read.asc function
>>> from
>>> SDMTools package.
>>>
>>> The error message is like  the following one:
>>>
>>>  Veg=read.asc("~/Desktop/natur_**inter.asc")
>>>>
>>> Error in if ((yll[[1]][1] == "yllcenter") | (xll[[1]][1] ==
>>> "YLLCENTER")) {
>>> :
>>>    missing value where TRUE/FALSE needed
>>> In addition: Warning message:
>>> In read.asc("~/Desktop/natur_**inter.asc") : NAs introduced by coercion
>>>
>>> Looking at different forums I found the following solution to this
>>> problem:
>>>
>>> library("rgdal")
>>> library("adehabitat")
>>> B1=readGDAL("~/Desktop/natur_**inter.asc")
>>> blaK <- spixdf2kasc(B1)
>>> write.asc(blaK, "~/Desktop/NEW_natur_inter.**asc", gz=FALSE)
>>>
>>> It used to solve my problem. The NEW .asc file did not display any error
>>> message when read with the read.asc function.
>>>
>>> However, since I updated to R 2.15.2 GUI 1.53 Leopard build 32-bit
>>> (6335),
>>> I can not use adehabitat package anymore, and I have not been able to
>>> find
>>> the "spixdf2kasc" function in the new adehabitat family packages. Now, I
>>> am
>>> not able to use new .asc files provided to me.
>>>
>>> Does anyone have an alternative solution for  the read.asc error? or an
>>> alternative for using "spixdf2kasc" function?
>>>
>>> Any help would be very appreciated. Thanks.
>>>
>>> Andres
>>>
>>> Additional infor about my R version:
>>> R version 2.15.2 (2012-10-26) -- "Trick or Treat"
>>> Copyright (C) 2012 The R Foundation for Statistical Computing
>>> ISBN 3-900051-07-0
>>> Platform: i386-apple-darwin9.8.0/i386 (32-bit)
>>>
>>> My computer:
>>> MacBook 2GHz Intel Core 2 Duo
>>> MAC OS X Version 10.6.8
>>>
>>>          [[alternative HTML version deleted]]
>>>
>>> ______________________________**_________________
>>> R-sig-Geo mailing list
>>> R-sig-Geo@r-project.org
>>> https://stat.ethz.ch/mailman/**listinfo/r-sig-geo<https://stat.ethz.ch/mailman/listinfo/r-sig-geo>
>>>
>>>
>>
>>
>>
> --
>
> ~$ whoami
> Mathieu Basille, PhD
>
> ~$ locate --details
> University of Florida \\
> Fort Lauderdale Research and Education Center
> (+1) 954-577-6314
> http://ase-research.org/**basille <http://ase-research.org/basille>
>
> ~$ fortune
> « Le tout est de tout dire, et je manque de mots
> Et je manque de temps, et je manque d'audace. »
>  -- Paul Éluard
>



-- 
_____________________________________

Andres Merino-Viteri
Centre for Tropical Biodiversity and Climate Change Research
School of Marine and Tropical Biology
James Cook University
Townsville, QLD 4811
Australia

E-mail: andres.merinoviteri@jcu.edu.au
            amerinoviteri@gmail.com

www.jcu.edu.au/ctbcc

	[[alternative HTML version deleted]]

