[Biomod-commits] Initial.State error (Hakim Abdi)

Daisy Englert Duursma daisy.duursma at gmail.com
Tue Dec 8 23:54:27 CET 2009


Dear Hakim,

A way  to specify your coordinates directly from your dataset and not from an

"extra file that has X and Y and is identical to the XY columns within
my dataset",

is to set CoorXY so that it reads in the X and Y columns from your dataset.


For example:

Read in your data file:

Grid.frog <- read.csv ("grid_frog_21Apr2009_dd.csv"))

Then set the X Y coordinates.

CoorXY <- Grid.frog[,2:3]

So column 2 is my X and column 3 is my Y. This way if anything is
updated you do not have to remake a file with just the coordinates.



Hope that helps,
Daisy




To: Hakim Abdi <hakim.abdi at uni-muenster.de>
Cc: biomod-commits at r-forge.wu-wien.ac.at
Message-ID: <202E7822-DD4B-45E0-8F74-EB790D455D16 at ujf-grenoble.fr>

On Tue, Dec 8, 2009 at 10:00 PM,
<biomod-commits-request at lists.r-forge.r-project.org> wrote:
> Send Biomod-commits mailing list submissions to
>        biomod-commits at lists.r-forge.r-project.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/biomod-commits
>
> or, via email, send a message with subject or body 'help' to
>        biomod-commits-request at lists.r-forge.r-project.org
>
> You can reach the person managing the list at
>        biomod-commits-owner at lists.r-forge.r-project.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Biomod-commits digest..."
>
>
> Today's Topics:
>
>   1. Re : error message Ensemble.Forecasting function
>      (Bruno Lafourcade)
>   2. Initial.State error (Hakim Abdi)
>   3. Re: Initial.State error (Wilfried Thuiller)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 07 Dec 2009 10:00:20 -0500
> From: Bruno Lafourcade <brunolafourcade at aol.com>
> Subject: [Biomod-commits] Re : error message Ensemble.Forecasting
>        function
> To: mdamen at uniroma3.it, biomod-commits at r-forge.wu-wien.ac.at
> Message-ID: <8CC4565213AF79B-197C-3868F at webmail-m071.sysops.aol.com>
> Content-Type: text/plain; charset="utf-8"
>
>
>
>
> Hi Manuela and other BIOMODers,
>
>
> I am very puzzled with this one. I have encounetered it several times before and it seems to come from
> various possibilities and I haven't yet figured out how to solve it completely.
>
> I believe some of the operations that the function is to be doing areencountering absent data, at least that's what I came up with.
> I would advise you to try and switch on/off some of the arguments. Ibelieve "binary" and "Test" would surely make a difference if
> switched off.
>
> Also, maybe just setting "repetition.models" to TRUE might skip the problem even if the others are kept as FALSE. It is a late
> improvement and might not totally be bug free on the overall of the function.
>
> Thanks for reporting any advances.
> Bruno
>
>
>
>
>
> -------
> Bruno Lafourcade
> Statistical tools engineer
>
> Laboratoire d'Ecologie Alpine, bureau 308
> CNRS - UMR 5553, 2233 rue de la piscine
> 38400 Saint Martin d'H?res
> -------
>
>
>
>
> -----E-mail d'origine-----
> De : mdamen at uniroma3.it
> A : biomod-commits at r-forge.wu-wien.ac.at
> Envoy? le : Jeudi, 3 D?cembre 2009 15:24
> Sujet : [Biomod-commits] error message Ensemble.Forecasting function
>
>
> Dear all,
>
> I encountered a problem with the Ensemble.Forecasting() function.
>
> I am working on 1 species (678 obs. - 10 variables).
>
> I get models with the function:
> Models(GLM=T, TypeGLM="poly", Test="AIC", GBM=T, No.trees = 5000, GAM= T,
> CTA=T, CV.tree =50, ANN=T, CV.ann=3, SRE=F, Perc025=TRUE, Perc05=FALSE,
> MDA=T, MARS=T, RF=T, NbRunEval = 3, DataSplit = 80, VarImport=5, Roc = T,
>      Optimized.Threshold.Roc = T, Kappa = F, TSS = F)
>
> ... then I projected the models:
> Projection (Proj = pres[,4:13], Proj.name="pres", GLM = T, GBM = T, GAM = T,
> CTA = T, ANN = T, SRE = F, Perc025 = T, Perc05 = F, MDA =T, MARS = T, RF =
> T, BinRoc = T, BinKappa = F, BinTSS = F, FiltRoc = F, FiltKappa = F,
> FiltTSS = F, repetition.models = F)
>
> finally the Ensemble.Forecasting function -
>
> Ensemble.Forecasting(Proj.name= "pres", weight.method = "Roc", decay = 1.6,
>                    PCA.median = F, binary = T, bin.method = "Roc",
>                    Test = T, repetition.models = F)
>
> gave me this error:
>
> Errore in if (sum(ProbData) != 0) { :
>  valore mancante dove ? richiesto TRUE/FALSE
>
> (The english translation of the second line is: "missig value where
> TRUE/FALSE is required")
>
> What is wrong?
> I would be very grateful for any help
>
> Manuela
>
> --
> Manuela D'Amen
> PhD student
> Lab Zoology and Animal Biology
> Department of Environmental Biology
> University of Roma Tre, Rome, Italy
>
>
> _______________________________________________
> 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
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.r-forge.r-project.org/pipermail/biomod-commits/attachments/20091207/7d19161e/attachment.html
>
> ------------------------------
>
> Message: 2
> Date: Mon, 7 Dec 2009 17:23:40 +0100
> From: Hakim Abdi <hakim.abdi at uni-muenster.de>
> Subject: [Biomod-commits] Initial.State error
> To: biomod-commits at r-forge.wu-wien.ac.at
> Message-ID:
>        <2616bc8f0912070823w5282d907m72f0822ad252c5e at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> 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-0001.htm
>
> ------------------------------
>
> Message: 3
> Date: Tue, 8 Dec 2009 08:29:22 +0100
> From: Wilfried Thuiller <wilfried.thuiller at ujf-grenoble.fr>
> Subject: Re: [Biomod-commits] Initial.State error
> To: Hakim Abdi <hakim.abdi at uni-muenster.de>
> Cc: biomod-commits at r-forge.wu-wien.ac.at
> Message-ID: <202E7822-DD4B-45E0-8F74-EB790D455D16 at ujf-grenoble.fr>
> Content-Type: text/plain; charset="iso-8859-1"
>
> 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-0001.htm
>
> ------------------------------
>
> _______________________________________________
> 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
>
>
> End of Biomod-commits Digest, Vol 8, Issue 3
> ********************************************
>



-- 
Daisy Englert Duursma


10A Carrington Rd
Hornsby, NSW 2077
Australia

Home: +61 (0)2 45 611 320
Mobile: +61 (0)4 21 858 456


More information about the Biomod-commits mailing list