R

baRcodeR 0.1.2 release - new linear barcodes

baRcodeR 0.1.2 is released on CRAN today! Download and install by install.packages("baRcodeR") Example linear barcode The major feature of this release is the ability to print linear (a.k.a normal) barcodes through specifying type = "linear" in create_PDF() rather than type = "matrix" which prints the usual QR code. The github repository is at yihanwu/baRcodeR. Minor notes on the implementation of these linear barcodes The linear barcodes are based on the code 128B specification (Wikipedia).

Icon making with ggplot2 and magick

Icon noun A person or thing regarded as a representative symbol or as worthy of veneration. A symbol or graphic representation on a screen of a program, option, or window. from Oxford English Dictionaries Fontawesome and the noun project along with other icon provides produce and distribute beautiful icons for free use. But sometimes, I would like to alter or create my own tiny 16x16 or 32x32 pixel wide icons without having to learn inkscape or any other svg editor.

Blogdown - shortcode for radix-like Bibtex

Generating a Bibtex citation in Hugo with a shortcode

RStudio Pandoc - HTML To Markdown

Using Pandoc to convert HTML to Markdown

Rrrrs in R - Letter frequency in R package names

Do R package authors really like adding extra r's to their package names?

Using taxa and metacoder to explore taxonomy of Vancouver's trees

From the last post, Vancouver has several common genus in its collection, such as Prunus and Acer. So rather than analyzing the diversity of Vancouver tree species on a species level, we could, with the help of some R packages, visualize the variety of taxonomic groups. First, we format the Vancouver tree dataset similar to before to get the proper scientific name. This is the same formatting done in the previous post.

Vancouver Trees - Vizualizing biodiversity, native and introduced trees

Following from the past post, this post is focused on visualizing diversity through the package vegan and also maps showing the presence of native/introduced trees. The most important code in this post is manipulating Spatial*DataFrames. The same files will be read in, including the native/introduced status downloaded from USDA PLANTS. library(rgdal) library(sp) library(raster) library(dplyr) library(httr) library(rvest) library(purrr) library(tidyr) # read in trees df trees_df<-read.csv("StreetTrees_CityWide.csv", stringsAsFactors = F) trees_df<-trees_df[trees_df$LATITUDE > 40 & trees_df$LONGITUDE < -100,] # read in polygons locmap<-readOGR("cov_localareas.

R Script prep for GOplot from Trinity

This post contains an adapted R script based on prep_n_run_GOplot.pl from Trinity, the denovo transcriptome assembler, for the times R cannot read in the produced EC.* files. prep_n_run_GOplot.pl is used to produce GOplot visualizing differential expression, sorted by GO terms (see http://wencke.github.io/). It uses the DE_analysis.DE_subset and DE.subset.GOseq.enriched files to produce two other files, EC.david. and EC.genelist used in GOplot. In most cases, this script words properly. However, sometimes when the text annotation contains special characters such as , EC.

Mapping ggplot geoms and aesthetic parameters

The sheer variety of geom_* in ggplot2 is overwhelming and astounding, especially with the control over the many aesthetics such as shape and color. For example, the ggplot2 cheat sheet is packed (link). I frequently forget which aes parameters exist for each geom_* and need a quick look at the help pages. Using the information from the cheatsheet, I was able to quickly summarize the aes parameters available for each geom_* (link).

Vancouver Trees - Getting Native/Introduced status from USDA

Getting native/introduced status of trees from the USDA PLANTS database using City of Vancouver street trees.