Hello, I am trying to simulate trees under a QuaSSE model where speciation is linearly related to a trait. However, I keep getting an error related to specifying the linear function for lambda.
Following the diversitree documentation and vignette, I set up the following: > lambda<- make.linear.x(0, 1) > mu<- function(x) constant.x(x, 0.03) > char<-make.brownian.with.drift(0,0.025) According to the documentation, the make.linear.x function takes two arguments, the lower bound and upper bound values that lambda can assume according to changes in the trait value. However, I get the following error when trying to simulate the tree: > tree.quasse(c(lambda,mu,char), max.taxa=20, max.t=Inf, include.extinct=FALSE, x0=0.1, single.lineage=TRUE, verbose=TRUE) Error in lambda(state) : argument "m" is missing, with no default I am not sure what argument "m" is. If I input an arbitrary third argument, I get an additional error: > lambda<- make.linear.x(0, 1, 2) Error in make.linear.x(0, 1, 2) : unused argument (2) When I look at the lambda object, it seems that "m" is the slope of the rate of change in lambda according to the trait value: > lambda function (x, c, m) { x[x < x0] <- x0 x[x > x1] <- x1 ans <- m * x + c ans[ans < 0] <- 0 ans } <environment: 0x11604ee70> However, according to the documentation it is not clear how to input the slope value to the simulation function, or how to decide what this slope should be* a priori.* Any assistance would be greatly appreciated. Thank you! -- Elizabeth Miller http://elizabethcmiller.weebly.com/ PhD Candidate: Wiens Lab Ecology and Evolutionary Biology University of Arizona [[alternative HTML version deleted]] _______________________________________________ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/