sub.paleoTS {paleoTS}R Documentation

Subset an evolutionary time series

Description

This function subsets a paleoTS object, returning a shorter series of specified or random samples from the original.

Usage

sub.paleoTS(y, ok = NULL, k = 0.1)

Arguments

y a paleoTS object
ok vector indicating which samples to retain; can be logical or numeric
k proportion of samples to retain, chosen randomly

Details

If ok = NULL, the subsetting is done by retaining a proportion k of the initial samples, chosen at random. If ok is specified, those samples indicated will be retained.

Value

the subetted paleoTS object

Author(s)

Gene Hunt

References

Hunt, G. 2006. Fitting and comparing models of phyletic evolution: random walks and beyond. Paleobiology 32:578–601.

See Also

as.paleoTS

Examples

 y <- sim.GRW(ns=100, ms=0, vs=0.3)
 plot(y)
 ys1<- sub.paleoTS(y, ok=y$mm > mean(y$mm))  # subsetting with logical ok
 ys2<- sub.paleoTS(y, ok=1:10)				 # subsetting with numeric ok
 ys3<- sub.paleoTS(y, k=0.1)				 # subsetting random 10%
 plot(ys1, add=TRUE, col="red")
 plot(ys2, add=TRUE, col="blue")
 plot(ys3, add=TRUE, col="grey", cex=2, pt.ch=1)

[Package paleoTS version 0.3-1 Index]