paternogbc / sensiPhy

R package to perform sensitivity analysis for comparative methods
http://onlinelibrary.wiley.com/doi/10.1111/2041-210X.12990/full
GNU General Public License v2.0
12 stars 4 forks source link

Issue with clade_discrete #190

Closed emilycwatt closed 2 years ago

emilycwatt commented 3 years ago

function

clade_discrete

Problem

I cannot get an output using the clade_discrete function using the example code given. I would be grateful for any help. Here are the two errors I get:

summary(clade_disc) Error in data.frame(clade removed = c, N.species = ce$N.species, q12 = numeric(length(c)), : arguments imply differing number of rows: 0, 3

sensi_plot(clade_disc) Clade argument was not defined. Plotting results for clade: Callitrichidae Use clade = 'clade name' to plot results for other clades Error in data.frame(clade removed = c, N.species = ce$N.species, q12 = numeric(length(c)), : arguments imply differing number of rows: 0, 3

Reproducible example

library(sensiPhy)
#### your code goes here 
# Load data:
data("primates")

# Create a binary trait factor 
primates$data$adultMass_binary<-ifelse(primates$data$adultMass > 7350, "big", "small")
# Model trait evolution accounting for influential clades
clade_disc <- clade_discrete(data=primates$data,phy = primates$phy[[1]],
                             model="ARD",transform="kappa",
                             trait.col = "adultMass_binary", clade.col = "family",
                             n.sim = 30, n.species=8,n.cores = 2)
# Check summary statistics:
summary(clade_disc)
# Visual diagnostics
sensi_plot(clade_disc)
paternogbc commented 3 years ago

Dear @emilycwatt,

could you please install the development version (see below) and try again? This should fix your issue. Otherwise, please report back here.

devtools::install_github("paternogbc/sensiPhy")