# Generate a random tree
tree <- ape::rtree(50)
# Simulate trait with strong phylogenetic signal
trait_data <- simulate_lambda_trait(0.8, tree)
# Verify the phylogenetic signal
trait_vector <- setNames(trait_data$trait, rownames(trait_data))
phytools::phylosig(tree, trait_vector, method = "lambda", test = TRUE)
Run the code above in your browser using DataLab