[Basta-users] difficulty with CensusToCaptHist

Shafkat Khan shafkat.khan at gmail.com
Tue Mar 22 19:57:29 CET 2016


Hello Owen:

Thanks for the quick response and the update! Yes, the model/code runs fine
with parallel=FALSE. I'll send on the data object to the email address you
provided.

Secondly, I have a coding question. In my data, I have survivorship of
individuals observed in plots located within high, mid, and low elevations.
I would like to model the plots as nested within elevations and examine the
effects of elevation on survivorship. I'm not sure what the syntax in this
case would be. I imagine
newcovar2<-MakeCovMat(~Elev+Plot,data=covar)   isn't correct, or atleast
plot(x, plot.trace=FALSE) prints out effects of all possible combination of
elevations and sites.

Would   newcovar3<-MakeCovMat(~Elev+(Plot/Elev),data=covar)    be the
correct syntax to show that uniquely labeled plots are nested within
elevations?

Your help is much appreciated!

Shafkat

Shafkat Khan
Ph.D Candidate
Odum School of Ecology
University of Georgia

I sometimes write in a blog: catching-dreams-in-green-leaves.blogspot.com

On Tue, Mar 22, 2016 at 5:47 AM, Owen Jones <jones at biology.sdu.dk> wrote:

> Hi Shafkat,
>
> 1) I have fixed the bug with CensusToCaptHist(). It will appear in the
> next version.
>
> At the moment it is in the development version of BaSTA on GitHub.
>
> You can source that particular function like this:
>
> install.packages("devtools")
> library(devtools)
>
> source_url("
> https://raw.githubusercontent.com/fercol/BaSTA/master/pkg/R/CensusToCaptHist.R
> ”)
>
> The whole development version of the package can be installed like this:
> library(devtools)
> install_github("fercol/BaSTA/pkg")
>
> 2) I have never seen the error message "could not find function
> “requireNamespace”” before.
>
> Does your model run with parallel = FALSE?
> If you send your data file (off list to jones at biology.sdu.dk) I will see
> if I get the same error and try to debug it.
> It’d be best if you send your data as an Rdata object.
> i.e. run:   save(VC2,file="VC2.RData”)
>
> Best wishes,
> Owen
>
>
> On 22 Mar 2016, at 04:50, Shafkat Khan <shafkat.khan at gmail.com> wrote:
>
> Hello Owen:
>
> Thanks a bunch for the prompt response! Your suggestion worked great and I
> was able to compile the matrices into a BaSTA object. I'm able to run
> the basta function for the default values just fine, but am having trouble
> with multiple chains.
>
> I'm using this code:
> out1<-basta(object = VC2, studyStart = 2009, studyEnd = 2017,
>             nsim = 4, parallel = TRUE, ncpus = 4)
>
> And getting this error message:
> Error in basta.default(object = VC2, studyStart = 2009, studyEnd = 2017,
>  :
>   could not find function "requireNamespace"
>
> I'm not sure what I need to do to avoid this error and run multiple
> chains/simulations. Any idea will be much appreciated. I can send on the
> data files if that would help. Many thanks!
>
> Shafkat
>
> Shafkat Khan
> Ph.D Candidate
> Odum School of Ecology
> University of Georgia
>
>
> On Mon, Mar 21, 2016 at 5:18 PM, Owen Jones <jones at biology.sdu.dk> wrote:
> Hi Shafkat,
>
> That looks like a bug.
> I’ll investigate and get back to you ASAP.
>
> In the meantime you could simply replace the ID with the rowname.
> i.e.
>
> x$ID <- rownames(x)
>
>
> Best wishes,
> Owen
>
> On 21 Mar 2016, at 21:37, Shafkat Khan <shafkat.khan at gmail.com> wrote:
>
> Hello:
>
> I've been trying to use CensusToCaptHist function on a dataset. Upon
> converting the detection dataset that I have (with ID and Date
> (of detection) as column header, the resulting matrix attributes seemingly
> new IDs to the existing record. E.g.
>
>      ID 2009 2010 2011 2012 2013 2014 2015 2016 2017
> 1     1    0    0    1    1    1    0    1    0    1
> 10    2    0    0    0    0    1    0    1    0    1
> 100   3    0    0    1    0    0    0    0    0    0
> 101   4    0    0    1    0    0    0    0    0    0
> 102   5    0    0    1    0    0    0    0    0    0
> 103   6    0    0    1    0    0    0    0    0    0
> 104   7    0    0    1    0    0    0    0    0    0
> 105   8    0    0    1    0    0    0    0    0    0
>
> Here, the ID I had listed in the census file doesn't match up with the
> output matrix IDs. For example, the second record, the ID #10 from the
> input file gets relabelled as ID # 2 in the output, which doesn't match the
> birth/death file I have with the initial IDs. Subsequently, the Datacheck
> results in an error message, which basically says that a bunch of the IDs
> have measurements after death or before birth, which I imagine is from
> being mismatched with original IDs.
>
> Is there a bug in the program? Or am I missing something? I formatted the
> datasets pretty much after the BaSTA users guide/vignette. I'm using the
> version 1.9.4 that I downloaded from the website and I'm using Rstudio. I
> have checked my data several times so that birthdeath and the
> detection/census files agree on dates when a given individual is
> alive/detected. Any help is much appreciated!
>
> Shafkat
>
> Shafkat Khan
> Ph.D Candidate
> Odum School of Ecology
> University of Georgia
>
>
> _______________________________________________
> Basta-users mailing list
> Basta-users at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/basta-users
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/basta-users/attachments/20160322/66473e46/attachment.html>


More information about the Basta-users mailing list