Learn R Programming

evoTS (version 1.0.3)

sim.multi.URW: Simulate multivariate evolutionary sequence data that evolve according to an Unbiased Random Walk

Description

Function to simulate multivariate evolutionary sequence data that evolve according to an Unbiased Random Walk

Usage

sim.multi.URW(
  ns = 30,
  anc = c(0, 0),
  R = matrix(c(0.5, 0, 0, 0.5), nrow = 2, byrow = TRUE),
  vp = 0.1,
  nn = rep(30, ns),
  tt = 0:(ns - 1)
)

Value

A multivariate evolutionary sequence (time-series) data set.

Arguments

ns

number of samples in time-series

anc

the ancestral trait values

R

the drift matrix

vp

within-population trait variance

nn

vector of the number of individuals in each sample (identical sample sizes for all time-series is assumed)

tt

vector of sample ages, increases from oldest to youngest

Author

Kjetil Lysne Voje

Examples

Run this code
## Create a multivariate dataset
data_set<-sim.multi.URW(40, R = matrix(c(0.2,0.1,0.1,0.3), nrow=2, byrow = TRUE))

## plot the data
plotevoTS.multivariate(data_set)

Run the code above in your browser using DataLab