[Biomod-commits] Initial.State error

Hakim Abdi hakim.abdi at uni-muenster.de
Mon Dec 7 17:23:40 CET 2009


Dear BIOMODers:

I searched the list regarding these two issues but I haven't been able to
find a solution.

I've been getting an error when trying to run the Initial.State command:

*> lerida <- read.csv("NewLerida.csv", h=T, sep=",", dec=".")*
*> coordinates(lerida)=~X+Y*
*> proj4string(lerida) <- CRS("+init=epsg:23031")*
*> Initial.State(Response=lerida[,c(9:10)], Explanatory=lerida[,23:40],
IndependentResponse=NULL, IndependentExplanatory=NULL)*

The error I get is:

*Error in `[.data.frame`(x at data, i, j, ..., drop = FALSE) : *
*  undefined columns selected*

Here's the summary of the dataset:

*Object of class SpatialPointsDataFrame*
*Coordinates:*
*      min     max*
*X  277500  358500*
*Y 4573500 4657500*
*Is projected: TRUE *
*proj4string :*
*[+init=epsg:23031 +proj=utm +zone=31 +ellps=intl +units=m +no_defs]*
*Number of points: 340*

So, I tried again but this time without specifying the coordinates and the
proj4string and it worked like a charm.

Does any one know why this error comes up?

Also, I have been specifying the coordinates using an extra file that has X
and Y and is identical to the XY columns within my dataset:

*> CoorXY <- read.csv("CoorXY.csv", h=T, sep=",", dec=".")*

Is anyone aware of a way to specify the XY coordinates (e.g. in the Models
command) to point to the XY columns that are already within the dataset
instead of specifying a separate coordinates file like I did above?

Thanks for your assistance regarding this matter.

Sincerely,

-- 
__________________________________
Hakim Abdi
Erasmus Mundus Master's Programme in
Geospatial Technologies

Institut für Geoinformatik
Universität Münster
32U 5755408.16mN, 404463.35mE
ifgi.uni-muenster.de

Instituto Superior de Estatística e Gestão de Informação
Universidade Nova de Lisboa
29S 4287095.5mN, 486099.7mE
www.isegi.unl.pt

www.geospatialtechnologist.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.r-forge.r-project.org/pipermail/biomod-commits/attachments/20091207/4f52be5e/attachment.htm 


More information about the Biomod-commits mailing list