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
# randomly sample a tree for this example | |
t <- rtree(10) | |
# check that the example tree is a phylo object | |
class(t) == "phylo" | |
# convert to RevGadgets plotting format | |
t_td <- convertTreeFormat(t) # [note, run the function code below before executing this line of code] | |
# The function: | |
# `tree` is the argument for your phylo object. |
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
##### Script to check if the authors of a paper have co-authored with | |
##### a potential reviewer within the past 4 years (following COI for | |
##### NSF and various journals). I make o guarantees this will work, | |
##### as name changes, variations in spellings, etc. might interfere | |
##### with the code. Please note that this does not check for other | |
##### potential conflicts such as mentorship relationships, etc. | |
library(lubridate) | |
library(scholar) |
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
readStochasticMaps <- function(map_paths, | |
burnin = 0.1, | |
combine_runs = TRUE) { | |
# read in map logs and remove burnin | |
maps <- vector("list", length = length(map_paths)) | |
for (i in 1:length(map_paths)) { | |
message(paste0("Reading in map log file ", i, "\n", | |
"This may take a while.")) | |
maps[[i]] <- read.table(file = map_paths[i], |
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
bgb_to_revgadgets <- function(results_path, geo_data_path, tree_path, area_names = NULL) { | |
# load biogeobears results object | |
load(results_path) | |
# change data directories in results object | |
res[["inputs"]]$geogfn <- geo_data_path | |
res[["inputs"]]$trfn <- tree_path | |
##### Process data for plotting ##### | |
# read in tree separately |