[Basta-users] Error with DataCheck

Fernando Colchero colchero at imada.sdu.dk
Thu Feb 14 08:42:25 CET 2019


Dear Aaron,

   I believe that the error is because the two matrices are read as data.frames and the values in them are not numeric. Maybe you can force Y to be a matrix by typing:

  Y <- as.matrix(Y)

   Let me know if that works.

  Best,

  Fernando
_________________________________

Fernando Colchero
Associate Professor
Department of Mathematics and Computer Science
Interdisciplinary Center on Population Dynamics

Tlf.              +45 65 50 23 24
Email          colchero at imada.sdu.dk
Web            www.sdu.dk/staff/colchero
Pers. web   www.colchero.com
Adr.             Campusvej 55, 5230, Odense, Dk

University of Southern Denmark
_________________________________

> On 13 Feb 2019, at 22.42, Aaron Reedy <amr3mb at virginia.edu> wrote:
> 
> I just resubmitted now that I am registered on the mailing list.
> 
> 
> I'm new to BaSTA and am a pretty novice R user. I think my question might be general to R and not specific to BaSTA. Either way, I am hoping the community can point me in the right direction. 
> 
> My dataset is 7700 lizards captured over 42 months in a closed island population. There were 4 sampling periods in each year and the sampling was close to 90% of the population captured during each sampling period (7-12 days). The vast majority of animals had lifespans shorter than 12 months. 
> 
> I first constructed my Capture History, Birth/Death Matrix, and Covariate Matrix (sex data for each individual). 
> 
> Then I merged the matrices with:
> inputMat <- merge(birthDeath, Y, by.x = "ID", by.y = "ID")
> inputMat <- merge(inputMat, covMat, by.x = "ID", by.y = "ID")
> 
> Things seem to work OK there. I view inputMat and everything looks as it should. 
> 
> Then when I run DataCheck with:
> newData <- DataCheck(inputMat, studyStart = 4, studyEnd = 46, autofix = rep(1, 7), silent = FALSE)
> 
> I get the following error:
> Error in rowSums(Y) : 'x' must be numeric
> 
> Can someone help me work on this error? 
> 
> Thanks for having a look at this. 
> 
> On Wed, Feb 13, 2019 at 4:39 PM Aaron Reedy <amr3mb at virginia.edu <mailto:amr3mb at virginia.edu>> wrote:
> I'm new to BaSTA and am a pretty novice R user. I think my question might be general to R and not specific to BaSTA. Either way, I am hoping the community can point me in the right direction. 
> 
> My dataset is 7700 lizards captured over 42 months in a closed island population. There were 4 sampling periods in each year and the sampling was close to 90% of the population captured during each sampling period (7-12 days). The vast majority of animals had lifespans shorter than 12 months. 
> 
> I first constructed my Capture History, Birth/Death Matrix, and Covariate Matrix (sex data for each individual). 
> 
> Then I merged the matrices with:
> inputMat <- merge(birthDeath, Y, by.x = "ID", by.y = "ID")
> inputMat <- merge(inputMat, covMat, by.x = "ID", by.y = "ID")
> 
> Things seem to work OK there. I view inputMat and everything looks as it should. 
> 
> Then when I run DataCheck with:
> newData <- DataCheck(inputMat, studyStart = 4, studyEnd = 46, autofix = rep(1, 7), silent = FALSE)
> 
> I get the following error:
> Error in rowSums(Y) : 'x' must be numeric
> 
> Can someone help me work on this error? 
> 
> Thanks for having a look at this. 
> 
> Aaron
> 
> -- 
> Aaron M. Reedy
> 
> NSF Postdoctoral Research Fellow in Biology
> 
> http://www.aaronmreedy.com/ <http://www.aaronmreedy.com/>
> http://www.evolutioned.org/ <http://www.evolutioned.org/>
> 
> 
> 
> -- 
> Aaron M. Reedy
> 
> NSF Postdoctoral Research Fellow in Biology
> 
> http://www.aaronmreedy.com/ <http://www.aaronmreedy.com/>
> http://www.evolutioned.org/ <http://www.evolutioned.org/>
> 
> _______________________________________________
> 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/20190214/1fb0b973/attachment-0001.html>


More information about the Basta-users mailing list