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
library(tidyverse) | |
#' Parse fossil calibration data in Sundue and Testo 2016 SI | |
#' | |
#' Testo WL, Sundue MA (2016) A 4000-species dataset provides new insight into | |
#' the evolution of ferns. Molecular Phylogenetics and Evolution 105:200–211. | |
#' https://doi.org/10.1016/j.ympev.2016.09.003 | |
#' | |
#' @param testo_sundue_2016_si_path Path to Sundue and Testo 2016 SI file | |
#' (xlsx format). |
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
library(yaml) | |
library(stringr) | |
# Names with "Jr." need to have this in the "suffix" field, or they won't get rendered properly | |
# Zotero apparently doesn't know about this, so fix them with this script. | |
# Read in a reference library in YAML format | |
# (e.g. exported from zotero) | |
refs_yaml <- read_yaml("main_library.yaml") |
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
taxonID | datasetID | datasetName | acceptedNameUsageID | parentNameUsageID | taxonomicStatus | taxonRank | verbatimTaxonRank | scientificName | kingdom | phylum | class | order | family | genericName | genus | subgenus | specificEpithet | infraspecificEpithet | scientificNameAuthorship | namePublishedIn | nameAccordingTo | modified | taxonConceptID | scientificNameID | references | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
54115096 | 140 | World Ferns in Species 2000 & ITIS Catalogue of Life: 2019 | NA | 54830341 | accepted name | species | NA | Cephalomanes atrovirens Presl | Plantae | Tracheophyta | Polypodiopsida | Hymenophyllales | Hymenophyllaceae | Cephalomanes | Cephalomanes | NA | atrovirens | NA | Presl | NA | Hassler M. | Nov 2018 | NA | ferns-1911-colgen | http://www.catalogueoflife.org/col/details/species/id/f5950556e578afe0332ef6a18360dd97 | |
54133783 | 140 | World Ferns in Species 2000 & ITIS Catalogue of Life: 2019 | 54115097 | NA | synonym | species | NA | Trichomanes crassum Copel. | Plantae | NA | NA | NA | NA | Trichomanes | Cephalomanes | NA | crassum | NA | Copel. | NA | NA | NA | NA | ferns-1915-syn-1 | http://www.catalogueoflife.org/col/details/species/id/bb5e2f017639f8fb9de177c |
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
# This function can be called inside of other functions to check | |
# if the names of the input match the names of the arguments | |
check_args <- function(call_match) { | |
call_names <- as.character(call_match) | |
arg_names <- names(as.list(call_match)) | |
stopifnot( | |
"Names of input must match names of arguments" = isTRUE(all.equal(call_names[-1], arg_names[-1])) | |
) | |
} |
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
library(tidyverse) | |
# Specify directory with files to get checksums | |
dir <- "my_folder" | |
# Get checksums | |
list.files(dir, full.names = TRUE) %>% | |
tools::md5sum() %>% | |
tibble(file = names(.), checksum = .) %>% | |
filter(!is.na(checksum)) %>% |
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?><beast beautitemplate='Standard' beautistatus='' namespace="beast.core:beast.evolution.alignment:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood" required="" version="2.6"> | |
<data | |
id="primates" | |
spec="Alignment" | |
name="alignment"> | |
<sequence id="seq_Gorilla" spec="Sequence" taxon="Gorilla" totalcount="4" value="AAGCTTCACCGGCGCAGTTGTTCTTATAATTGCCCACGGACTTACATCATCATTATTATTCTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATTCTCTCTCAAGGACTCCAAACCCTACTCCCACTAATAGCCCTTTGATGACTTCTGGCAAGCCTCGCCAACCTCGCCTTACCCCCCACCATTAACCTACTAGGAGAGCTCTCCGTACTAGTAACCACATTCTCCTGATCAAACACCACCCTTTTACTTACAGGATCTAACATACTAATTACAGCCCTGTACTCCCTTTATATATTTACCACAACACAATGAGGCCCACTCACACACCACATCACCAACATAAAACCCTCATTTACACGAGAAAACATCCTCATATTCATGCACCTATCCCCCATCCTCCTCCTATCCCTCAACCCCGATATTATCACCGGGTTCACCTCCTGTAAATATAGTTTAACCAAAACATCAGATTGTGAATCTGATAAC |
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
--- | |
title: "`posterdown`: Generate Reproducible & Live HTML and PDF Conference Posters Using RMarkdown" | |
author: | |
- name: Brent Thorne | |
affil: 1 | |
orcid: '0000-0002-1099-3857' | |
- name: Another G. Author | |
affil: 2 | |
affiliation: | |
- num: 1 |
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
#' force_ultrametric | |
#' | |
#' Force the branch lengths of a tree to be ultrametric. Most useful in cases | |
#' when a time-tree is imported into R but the branch lengths are not exactly | |
#' ultrametric due to rounding error. Uses a different (faster) method from | |
#' phytools::force.ultrametric() | |
#' | |
#' @param tree Input tree; list of class "phylo". Should already be ultrametric | |
#' within rounding error. | |
#' @param force.positive Logical; should the branch lengths be forced to be |
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
# Filter a list of references in YAML format to those cited in an RMD file | |
# | |
# The YAML list should be exported from Zotero | |
# like this: file -> "export library" -> "Better CSL YAML" | |
# | |
# Exporting YAML from Zotero requires the Better Bibtex for Zotero extension | |
# to be installed https://retorque.re/zotero-better-bibtex/ | |
library(tidyverse) | |
library(yaml) |
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
library(tidyverse) | |
path_to_csv_file <- "change/this/to/the/path/on/your/machine.csv" | |
# Load the participants responses | |
# The `#` column has a unique ID for each answer, but this is not the same | |
# as the user-entered unique ID (those are unfortunately NA in some cases as the | |
# participant didn't answer that question) | |
partic <- read_csv(path_to_csv_file) %>% | |
rename(num = `#`) |