get_subsampled_tree: Gets subsampled tree - retaining events information...

get_subsampled_treeR Documentation

Gets subsampled tree - retaining events information appropriately

Description

Gets subsampled tree - retaining events information appropriately

Usage

get_subsampled_tree(
  tree,
  N,
  tips = tree$edge[c(which(tree$state == 0 & tree$edge[, 2] <= length(tree$tip.label)),
    sample(which(tree$state != 0 & tree$edge[, 2] <= length(tree$tip.label)), N)), 2]
)

Arguments

tree

simpop

N

integer. Number of tips to subsample (ignored if tips is specified).

tips

integer. node id of tips to subsample. Must include out-group.

Value

simpop object

Examples

cfg=getDefaultConfig(target_pop_size =5e4,rate=0.1)
params=list(n_sim_days=2*365,b_stop_at_pop_size=1,b_stop_if_empty=0)
growthphase=sim_pop(NULL,params=params,cfg)
stree=get_subsampled_tree(growthphase,50)

NickWilliamsSanger/rsimpop documentation built on Sept. 6, 2024, 12:42 a.m.