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
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo