R

The dating game

Dates are not so sweet It is known: parsing dates entered by humans is a huge pain: Source: https://xkcd.com/1179/ ISO 8601 nerds: a crack has developed in the old way. The new year has wounded both the m/d/yy and the d/m/yy factions. The time is ripe for a new global order. TONIGHT (2020-01-01) WE RIDE https://t.co/1YTL1SWDm2 — Brooke Watson Madubuonwu (@brookLYNevery1) January 1, 2020 Dates are a never-ending source of fresh hell.

nice selection

I started writing in R before the tidyverse became a thing and I never really had to think about non-standard evaluation when writing functions. Those days are long past and I’ve recently struggled with the challenge when writing functions for the R4EPIs project, which would stick out like ugly little trolls along side tidyverse functions. One of my biggest struggles was trying to figure out how, excactly to select a varaible from a user as either a character string or a bare variable.

Splitting Hairs: poppr version 2.7

Positive Contact This version of poppr is a direct result of feedback that was prompted by my own feedback. I’m always grateful for eagle-eyed users of poppr who report when things are going awry. Recently, I had noticed that poppr was cited in a recent review on the analysis of polyploid genetic data (Meirmans, Liu, and Tienderen 2018) that highlighted some limitations with established methods, including Bruvo’s distance (Bruvo et al.

I C Bugs

A Brown marmorated stink bug female from a laboratory colony on a common bean leaf, photographed in the laboratory of Fondazione Edmund Mach, Italy. URL: https://commons.wikimedia.org/wiki/File:Halyomorpha_halys_lab.jpg Occasionally, I hear people complain about the strict policies of CRAN, but I for one quite apprecieate them, especially when dealing with hidden errors in compiled code. Not twenty-four hours after I had submitted poppr version 2.6.0 to CRAN did I receive an email from none other than Brian D.

Poppr 2.6.0: Better Network Plotting

Poppr version 2.6.0 has officially been released on CRAN and should be built for all operating systems within the next few days 🎉. You can check out the NEWS for full details. This release features a new function called boot.ia() to assess how the Index of Association responds to repeat observations (clones). Perhaps the biggest feature is the change in how minimum spanning networks are plotted. Minimum spanning networks were originally implemented in poppr by Javier Tabima and I, and since then they’ve gone through some tweaking, eventually including features like reticulation of equivalent paths and a GUI to help construct these networks.

Using a custom library in R

I’ve been using a custom library for R since 2012 and I’ve never looked back. I’ve not seen many tutorials for people do do this through R, so I figured I’d write a quick one. Where does your R package library live? You can usually find this out by typing .libPaths() in your R console. If you have an out-of-the-box installation, it will generally be somewhere like: C:/Program Files/R/R-3.

adegenet

Adegenet was created by Thibaut Jombart and has been on CRAN since April, 2007. I was involved in the migration to version 2.0 in the summer of 2015, which included consolitading S4 methods and including the strata() methods. I have been maintaining the package by fixing bugs and responding to CRAN requests since 2020. Abstract Toolset for the exploration of genetic and genomic data. Adegenet provides formal (S4) classes for storing and handling various genetic data, including genetic markers with varying ploidy and hierarchical population structure (‘genind’ class), alleles counts by populations (‘genpop’), and genome-wide SNP data (‘genlight’).

poppr

Poppr provides open-source, cross-platform tools for quick analysis of population genetic data enabling focus on data analysis and interpretation. While there are a plethora of packages for population genetic analysis, few are able to offer quick and easy analysis of populations with mixed reproductive modes. Poppr’s main advantage is the ease of use and integration with other packages such as adegenet and vegan, including support for novel methods such as clone correction, multilocus genotype analysis, calculation of Bruvo’s distance, and the index of association.

The Carpentries Workbench

The Carpentries Workbench is a trio of R packages that deploy, validate, and style Carpentries-style lessons in a modular way. This design allows lesson developers, maintainers, and contributors to focus on the content, not the tooling. Installation To install the workbench, you need to have R, git, and pandoc installed. It is recommended to use RStudio, but it is possible to do so without RStudio. Once you have these installed, you can install the Workbench packages like so: