foss_data <- read.table("mukunda_foss.log", sep = '\t', head = TRUE) head(foss_data) View(foss_data) ## for view
library(FossilSim) foss_data <- read.table("mukunda_foss.log", sep = '\t', head = TRUE) foss_function <- function(data_frame, arg_1, arg_2) ## data_frame: my dataset(.log file), arg : which row { ## for arg1 m1 <- data_frame$mu[arg_1] ## mu value stored in m1 l1 <- data_frame$lambda[arg_1] ## lamda value stored in m1 p1 <- data_frame$psi.1.[arg_1] ## psi value stored in p1 ## for arg2 m2 <- data_frame$mu[arg_1] l2 <- data_frame$lambda[arg_1] p2 <- data_frame$psi.2.[arg_1] ## store mu, lamda and psi in vector mu_value <- c(m1,m2) lambda_value <- c(l1,l2) psi_value <- c(p1,p2) all_values <- c(mu_value,lambda_value,psi_value) ## n = 666 (given) ## numbsim = 1 ## from LONI times = (29,70) tree <- sim.fbd.rateshift.taxa(666,1,lambda = lambda_value, mu=mu_value, psi=psi_value, times=c(29,70), complete = FALSE ) { return(rangeplot.asymmetric(tree[[1]])) ## draws a sim.fbd.rateshift.taxa tree } return(all_values) # returns all the values } foss_function(foss_data,120,20)
library(FossilSim) foss_data <- read.table("mukunda_foss.log", sep = '\t', head = TRUE) foss_function <- function(n_extant, n_trees, data_frame, mu, lambda, psi, rows, times) { mi <- c(foss_data [rows, mu]) li <- c(foss_data [rows, lambda]) pi <- c(foss_data [rows, psi]) tree <- sim.fbd.rateshift.taxa(n_extant, n_trees, li, mi, pi, times, complete = TRUE) { return(rangeplot.asymmetric(tree[[1]])) } # return(foss_model) } foss_function(666,1, foss_data, mu = "mu", lambda = "lambda", psi = "psi.1.", c(10,12) ,times = c(29,70) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.