[Biomod-commits] Initial.State error
Wilfried Thuiller
wilfried.thuiller at ujf-grenoble.fr
Tue Dec 8 08:29:22 CET 2009
Dear Hakim,
BIOMOD does not handle spatial data yet. The Initiate.State function accept data.frame but cannot handle spatial frame (like proj4string).
I understand that it might be needed for some people but at the same time, others do not have spatial data or are not used to use the spatial function of R.
There is no way of specifying the coordinate data in the Models function yet. You did right. This is something we might think to include in a next version though.
The next version which should come out soon will be able to handle raster (grid) data. Will be released probably in January.
Best
Wilfried
Le 7 déc. 2009 à 17:23, Hakim Abdi a écrit :
> 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
> _______________________________________________
> 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 63 54 53
fax: +33 (0)4 76 51 42 79
Email: wilfried.thuiller at ujf-grenoble.fr
Home page: 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
FP6 European EcoChange project: http://www.ecochange-project.eu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.r-forge.r-project.org/pipermail/biomod-commits/attachments/20091208/2bc0f052/attachment.htm
More information about the Biomod-commits
mailing list