[Basta-users] difficulty with CensusToCaptHist

Owen Jones jones at biology.sdu.dk
Tue Mar 22 10:47:05 CET 2016


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<mailto: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<mailto: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<mailto: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/851de43b/attachment.html>


More information about the Basta-users mailing list