Learn R Programming

TreePar (version 3.3)

create.mat: create.mat: Generates input for LikAge and bd.age.optim.matlab.

Description

create.mat generates input for LikAge and bd.age.optim.matlab.

Usage

create.mat(x, numgridpts=500, path, matfilename="setup")

Arguments

x
Vector of speciation times in the phylogeny. Time is measured increasing going into the past with the present being time 0. x can be obtained from a phylogenetic tree using getx(TREE).
numgridpts
Number of gridpoints to be used in the numerical likelihood calculation in LikAge or bd.age.optim.matlab.
path
Path where your MCR (Matlab Compiler Runtime) is installed (for details see ?LikAge).
matfilename
File matfilename.mat is created which contains input (speciation times) in a valid format for LikAge and bd.age.optim.matlab.

Value

res
0 is returned. The file for downstream analysis is saved as matfilename.mat.

References

H. Alexander, A. Lambert, T. Stadler. Quantifying Age-Dependent Extinction from Species Phylogenies. Submitted.

Examples

Run this code
## You need MCR to run the example
## directory where MCR is installed
# path<-"/Applications/MATLAB_R2014a_node.app/"
## location of folder TreePar_Matlab containing compiled Matlab applications (see ?LikAge)
# locationMat<-"/Users/tstadler/Documents/Data/Uni/Research/R/TreeParProject/TreePar_Matlab"
##
# x<-1:20
# setwd(paste(locationMat,"/compiled",sep=""))
# out<-create.mat(x,path=path)

Run the code above in your browser using DataLab