Learn R Programming

BMhyb (version 1.5.2)

SimulateTipData: Simulate data on a network

Description

Simulate comparative data under the given a network and relevant parameters.

Usage

SimulateTipData(phy, flow, params, suffix="_DUPLICATE")

Arguments

phy

a phylo object.

flow

data.frame of the flow parameters.

params

named vector of BMhyb parameter values.

suffix

taxa are duplicated on the network; this suffix distinguishes them.

Value

a named vector of tip values.

Details

This function simulates tip data on a network, under a BMhyb model.

References

Jhwueng D.C. and O'Meara B.C. 2015. Trait evolution on phylogenetic networks. Submitted.

Examples

Run this code
# NOT RUN {
	library(TreeSim)
	#set up the number for non hybrid species
	non.hybrid <- 3
	#set up the number for hybrid species
	hybrid <- 1
	#set up the gene flow proportion
	flow<- 0.5
	#set up the hybridization type to original
	origins<- "individual"
	#start to simulate the network
	network<-SimulateNetwork(ntax.nonhybrid=non.hybrid, ntax.hybrid=hybrid,
	flow.proportion=flow, origin.type="individual", birth = 1, death = 0.5,
	sample.f = 0.5, tree.height = 1, allow.ghost=FALSE)
	parameters <- c(0.01,1,1,0,0)
	names(parameters) <- c("sigma.sq", "mu", "bt", "vh", "SE")
	tip.data <- SimulateTipData(network$phy, network$flow, parameters)
	print(tip.data)
	
# }

Run the code above in your browser using DataLab