Publications by R on YIHAN WU
Visualization of Vancouver Cherry Trees with ggplot2 and R
Motivation: I created this image as part of a graduate course I audited in 2018. In short, I learned the very simple basics of working with a shapefile (.kml) in R. Otherwise, everything was done using ggplot2 and base R. It also was originally knit as an html file with tabs. Data City of Vancouver Trees dataset with locations (direct link downl...
5711 sym R (12792 sym/31 pcs) 24 img
Parameter testing In stacks, SNP extraction and visualization in R
The recommended way to figure out the best parameters to use in stacks for denovo RAD-seq analysis is to test parameter combinations for M and n. (Paris et al. 2017, Rochette and Catchen 2017). The authors of stacks recommend testing M and n from 1 to 9 and then visualizing the distribution of loci against the number of SNPs on the loci. From Ro...
1677 sym R (2097 sym/5 pcs) 6 img
R Package Tutorial
Edited by Rob Colautti. Originally posted on https://colauttilab.github.io/biol812.html on March 15th. Most of the general content can be found in Hadley Wickham’s R Packages book available for free online. It goes into detail on almost everything you would need to know to make a package. For a quick refresher, see Hilary Parker’s post on a �...
6751 sym R (1857 sym/11 pcs)
baRcodeR 1.1 preCRAN release a.k.a what are all these parameters for label layout?
The newest version of baRcodeR (v 1.1) is now on github as the development branch. At the moment, you can download the R package through devtools::install_github("yihanwu/baRcodeR", ref = "development") CRAN submission can take a long time (more than a month for baRcodeR’s first acceptance) and so I thought I would write a record of why I chang...
4852 sym R (65 sym/1 pcs)
Use .Rmd for projects in Academic + What happens when embedding a htmlwidget
Yihui’s minimal theme for blogdown is wonderful but the Academic theme by G. Cushen provides several benefits, the main one for me being the site is essentially a better-looking electronic CV. blogdown + hugo also makes it easy for me to add images and keep everything organized on a git repository from within RStudio. Unlike many other themes, ...
2577 sym R (1278 sym/3 pcs)
Vancouver Trees – Getting Native/Introduced status from USDA
Motivation: I converted a KML shape file into a data frame in my previous post on cherry trees in Vancouver but I figured I should learn to actually work with shape files. I thought an easy figure to make was to show which parts of Vancouver had introduced trees and native trees but it turned out harder than I thought. Fortunately, what I learned...
3540 sym R (6073 sym/13 pcs)
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 cheatshee...
1282 sym R (826 sym/4 pcs) 2 tbl
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 ...
1945 sym R (1717 sym/1 pcs)
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(rg...
3279 sym R (8673 sym/15 pcs) 8 img 2 tbl
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 prop...
3453 sym R (8336 sym/10 pcs) 2 img