Ecology BibTeX Style Files
I posted some BibTeX style files to GitHub. I generated these files over the years using the custom-bib LaTeX package. Where I could find my copy of the .dbj file I have included it as well. You can...
View ArticleCross-Referencing Line Numbers in LaTeX
One of the more tedious elements of the scientific publishing process is cross-referencing all your revisions in a reply letter to the editor. Typically you make changes in your manuscript and then...
View ArticleDebugging R Functions
Knowing how to debug functions is a critical skill if you want to work proficiently in R. In my experience, many graduate student R users aren't aware of the debugging options. Maybe this stems from...
View ArticleAn Introduction to reshape2
reshape2 is an R package written by Hadley Wickham that makes it easy to transform data between wide and long formats.What makes data wide or long? Wide data has a column for each variable. For...
View ArticleLabelling Panels in R
Cole Monnahan writes:I've got a multipanel plot and simply want to add "(a)", "(b)", etc. to it. I've always cheated and used legend:add.label <- function(label, ...) legend("topleft", legend=" ",...
View ArticleC++ with R on OS X Mavericks
Incorporating bits of C++ into your R coding through the Rcpp package is a great way to remove bottlenecks in your code and dramatically improve speed — particularly for operations that requires lots...
View Articleplyr: Split-Apply-Combine for Mortals
Along with my earlier post on the reshape2 package, I will continue to post my course notes from Data Wrangling and Visualization in R, a graduate-level course I co-taught last semester at Simon Fraser...
View ArticleMarc Mangel's Scientific Career Advice
Marc Mangel visited Simon Fraser University as this year's Biology Graduate Student Society hosted speaker. He gave a career-advice workshop to about 15 lucky grad students. Each attendee submitted a...
View ArticleFitting Gamma GLMs Multiple Ways
A Gamma error distribution with a log link is a common family to fit GLMs with in ecology. It works well for positive-only data with positively-skewed errors. The Gamma distribution is flexible and can...
View ArticleCitations and Citation Managers
I wrote the following notes for a graduate student publishing workshop at Simon Fraser University organized by Amanda Kissel. When to citeOpinions vary widely on when, where, and how often to cite and...
View ArticleGamma Hurdle Models
Zero inflationEcologists often run into a scenario where their response data have more zeros than expected if the process generating their data was purely from a standard probability distribution. For...
View ArticleCentering factor interactions
I've encountered a number of people wondering about centering and scaling predictors in the context of model averaging. Here, centering refers to subtracting the mean and scaling refers to dividing by...
View Articledplyr and pipes: the basics
The dplyr R package is awesome. Pipes from the magrittr R package are awesome. Put the two together and you have one of the most exciting things to happen to R in a long time.dplyr is Hadley Wickham's...
View ArticleThe TMB R package
I'd heard whispers of this new R package TMB and finally spent some time playing with it in the last few days. It's incredible — fast like ADMB (faster?), has built-in parallel functionality, has other...
View ArticleEcology BibTeX Style Files
I posted some BibTeX style files to GitHub. I generated these files over the years using the custom-bib LaTeX package. Where I could find my copy of the .dbj file I have included it as well. You can...
View ArticleCross-Referencing Line Numbers in LaTeX
One of the more tedious elements of the scientific publishing process is cross-referencing all your revisions in a reply letter to the editor. Typically you make changes in your manuscript and then...
View ArticleDebugging R Functions
Knowing how to debug functions is a critical skill if you want to work proficiently in R. In my experience, many graduate student R users aren’t aware of the debugging options. Maybe this stems from...
View ArticleAn Introduction to reshape2
reshape2 is an R package written by Hadley Wickham that makes it easy to transform data between wide and long formats.What makes data wide or long?Wide data has a column for each variable. For example,...
View ArticleLabelling Panels in R
Cole Monnahan writes:I’ve got a multipanel plot and simply want to add “(a)”, “(b)”, etc. to it. I’ve always cheated and used legend:add.label <- function(label, ...) legend("topleft", legend=" ",...
View Article