This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Pkg | |
using Pkg # for Pkg.add, Pkg.PackageSpec | |
using DifferentialEquations | |
using Plots | |
using BenchmarkTools # for @benchmark | |
using LSODA # for lsoda() | |
#Pkg.resolve() | |
using Sundials # for CVODE_BDF() e.g. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################## | |
# Revising Chris Rackauckas's "exp_euler_test.jl" from | |
# Julia 0.6 so it works in Julia 1.1 | |
######################################################## | |
# | |
# Original 0.6 code from: | |
# | |
# ChrisRackauckas/exp_euler_test.jl | |
# https://gist.github.com/ChrisRackauckas/cf91f4575b0587a45c72620384612b82 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("ape") | |
# print tree in hierarchical format | |
####################################################### | |
# prt | |
####################################################### | |
#' Print tree in table format | |
#' | |
#' Learning and using APE's tree structure can be difficult and confusing because much of the information is | |
#' implicit. This function prints the entire |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Laying out the likelihood equation in ape::birthdeath | |
# Calculating LnL of a tree under a birth-death process | |
####################################################### | |
# Located in: | |
# /drives/GDrive/z_help/ClaSSE_LnLs/grok_classe_setup/ | |
####################################################### | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install.packages("devtools") | |
library(devtools) | |
install_github("nmatzke/rexpokit") | |
install.packages("phytools") | |
library(phytools) | |
install.packages("geomorph") | |
install.packages("BioGeoBEARS") | |
install.packages("plot3D") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple setup of a human/chimp/etc. phylogeny | |
# by Nick Matzke | |
####################################################### | |
# Phylogeny versus cladogram | |
####################################################### | |
# Tree specification | |
newick_string = "((((human:6,chimp:6):1,gorilla:7):6,orang:13):5,gibbon:18);" | |
tr = read.tree(file="",text=string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
####################################################### | |
# Figuring out the Beast2 GeneralSubstitutionModel | |
####################################################### | |
# The Beast2 documentation says: | |
# | |
# file:///Applications/BEAST_2.4.3/Beast2_XML_as_HTML_help/beast.evolution.substitutionmodel.GeneralSubstitutionModel.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
####################################################### | |
# These functions are some utilitys for dealing with | |
# annoying features of R's use of data.frames, e.g. | |
# the tendency for some functions to have something that | |
# looks like a data.frame, but is actually a series of lists. | |
# | |
# Also, dfnums_to_numeric semi-intelligently converts | |
# columns with numeric data to numeric (rather than | |
# factor or character). | |
####################################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example converting between | |
# birth rate, death rate (speciation and extinction) | |
# and | |
# r (diversification rate) and epsilon (relative death rate) | |
library(ape) | |
library(BioGeoBEARS) | |
# Load the Psychotria tree | |
trfn = np(paste(addslash(extdata_dir), "Psychotria_5.2.newick", sep="")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install optimx | |
install.packages("optimx", dependencies=TRUE, repos="http://cran.rstudio.com") | |
# Install BioGeoBEARS from CRAN 0-cloud: | |
#install.packages("BioGeoBEARS", dependencies=TRUE, repos="http://cran.rstudio.com") | |
# If default install for BioGeoBEARS doesn't work, install dependencies in this order, | |
# then install BioGeoBEARS from source: | |
install.packages("Rcpp", dependencies=TRUE) | |
install.packages("RcppArmadillo", dependencies=TRUE) |