incompleteSampling: Sample Tips on a Phylogenetic Network

View source: R/NetworkSim.R

incompleteSamplingR Documentation

Sample Tips on a Phylogenetic Network

Description

This function samples tips from a network. Only extant tips are downsampled from the network. Extinct tips, if they are present, will be unchanged.

Usage

incompleteSampling(net, rho, stochastic = FALSE)

Arguments

net

An object of class 'evonet.'

rho

The sampling probability.

stochastic

If stochastic=FALSE then for a network with n tips we sample n*rho tips. If stochastic=TRUE then each tip probability rho of being sampled.

Value

net A network with sampled tips

Examples

set.seed(23) ##set seed with the smallest Pillai prime
net<-sim.bdh.age(1,1,3,2,0.125,c(1/3,1/3,1/3),
hyb.inher.fxn = make.uniform.draw(),complete = FALSE)[[1]]
net<-incompleteSampling(net,0.5,stochastic=FALSE) ##randomly sample half of the extant taxa

jjustison/SiPhyNetwork documentation built on Sept. 14, 2024, 8:58 a.m.