Category Archives: R

Posts that contain R code and describe how to do something in R.

Data Wrangling Webinar and IFAR Chapter Update

A week or so ago I participated in the “Data Wrangling” webinar provided by RStudio.  I found Garret Gromelund’s descriptions of the functions in tidyr and dplyr to be fantastic.  A recording of the webinar is available here on the RStudio … Continue reading

Posted in R | Tagged , , ,

Plotting Fundamentals Chapter

I have uploaded a draft of Chapter 3 — Plotting Fundamentals — for the Introduction to Fisheries Analyses with R (IFAR) book (note the new name).  This chapter is meant to be a quick introduction to plotting in base R for plots … Continue reading

Posted in Fisheries Science, R | Tagged , , , , , | Leave a comment

Introduction to R Chapter for IFSWR Book

I have uploaded a draft of Chapter 1 — A Very Brief Introduction to R — to Introduction to Fisheries Science with R book.  This chapter is very bare bones as there are many great introductions to R on the … Continue reading

Posted in Administration, R | Tagged , , , , | Leave a comment

Two New Cumulative Sum Functions

In this document on RPubs, I describe two functions in FSA for computing cumulative sums.  The first is pcumsum() for computing the cumulative sum NOT including the current value and the second is rcumsum() for computing the “reverse” cumulative sum.

Posted in Fisheries Science, R | Tagged , , | Leave a comment

2 New (Draft) Chapters for Intro Fish Science with R

I have added two new drafts of chapters for the Introductory Fisheries Science with R book.  All draft chapters to the book, including these two new ones, are available on the IFSWR Vignettes page.  Any feedback on any of the chapters … Continue reading

Posted in Administration, R | Tagged , , , , , , | 7 Comments

Efficiently Adding Gabelhouse Lengths and Relative Weights to a data.frame (using dplyr)

In this post on RPubs, I demonstrate how to use new functions (psdAdd() and wrAdd()) in the FSA package, along with functions in the dplyr package, to efficiently add Gabelhouse length category and relative weight variables for all species in … Continue reading

Posted in Fisheries Science, R | Tagged , , , , , , ,

Updated dplyr Examples

Over the summer I made two posts about using the dplyr package.  The first was an example of the dplyr verbs applied to fish data.  The second was an example of modifications that I had made to lencat() to work better … Continue reading

Posted in R | Tagged , , , | 4 Comments

Changes to FSA — Size Structure

I have added a (very rough) first draft to the Size Structure chapter of the forthcoming Introductory Fisheries Science with R book on the book’s fishR webpage.  Accompanying this chapter are major changes to all of the proportional size distribution … Continue reading

Posted in Administration, Fisheries Science, R | Tagged , , , , , ,

Age-Length Keys in FSA

I have updated the age-length key related functions in FSA and the age-length key vignette.  The details are below.   Let me know if you have questions or suggestions. FSA Changes All code that used ageKey(), ageKeyPrep(), and ageKeyPlot() should … Continue reading

Posted in Administration, Fisheries Science, R | Tagged , , ,

Changes to FSA — Estimating Abundance

I mentioned previously, that I have been updating the Mark-Recapture vignettes.  That has morphed into a document that is an update of the Mark-Recapture Closed and Open vignettes and the depletion/removal vignettes and associated FSA functions.  Some of the changes … Continue reading

Posted in Administration, Fisheries Science, R | Tagged , , , , , , | 4 Comments