Help with plotting diversification rates using LASER
Hi,
I have been trying to use the LASER package in R to plot rates of diversification for my data. However, I am running into the following error.
plotRate(v,pars)
Error in pars$lam0 : $ operator is invalid for atomic vectors
v is my numeric vector of branch lengths, pars is a list with the 4 parameters (lam0, k, mu0, z) that I entered manually after fitting the different models - fitSPVAR, fitEXVAR, fitBOTHVAR and checking the values I get each time.
Is there anything inconsistent with the kind of data I should be entering? I'd be grateful if anyone can point me in the right direction.
• 2,098 views
•
link
1 answer
According to your comment, you did not create a list, just a vector. Try this:
pars <- as.list( c( lam0 = 1, k = 2, mu0 = 3, z = 4 ) )
• 0 views
•
link
Log in to answer this question.
What happens if you try to access
pars$lam0? e.gsummary(pars$lam0)orhead(pars$lam0). And how did you createdpars?I created pars as a list.
pars=c(lam0, k, mu0, z)where the 4 parameters are all numeric values