This half-day workshop will provide an introduction (or reintroduction) to R for fisheries biologists and technicians in the Wisconsin DNR. The first two hours will introduce basic R concepts and methods for size structure analyses with data from the Fisheries Management Database. In the second two hours, participants may choose one of two tracks. The first track will continue with the basic introduction by having participants apply what was learned in the first two hours in a moderated hands-on activity. The second track will provide participants with an introduction to plotting fisheries data with the ggplot2 R package.
Pre-Workshop Preparation
Perform the following tasks before the workshop.
- Install R and RStudio — You will need at least R version 3.1.2 and RStudio version 0.99.XXX for the workshop. If you participated in a similar workshop last year, then you should have adequate versions. If you did not or have not had R/RStudio installed on your computer, then you will need to work with your RIMS to have it installed on your work computer prior to the workshop. Here are directions for installing R/RStudio on a personal computer.
- Prepare RStudio — The default settings for RStudio can be modified for more effective use during the workshop (and after). Here are my suggested modifications.
- Install Packages -- Workshop materials depend on several additional packages being installed for R/Rstudio, including the FSA and fishWiDNR packages. If you took the workshop last year, then these packages need to be updated. If you did not take the workshop last year, then these packages need to be installed. Follow these directions to install or update the packages required for the workshop.
- Getting Started with RStudio — Review this material that briefly introduces RStudio.
- Create a Workshop Folder — Create a folder on your computer that will contain all materials from the workshop (for those described below and created at the workshop).
-
Download Data -- We will use a pull of Raw Fish Data from the Fisheries Management Database in the workshop. You should download this file from the internal WiDNR server at this directory structure
FH_Projects
>SV_ContinuingEducation
>R
>Workshops
>March 2016
.
The following two items should be completed before the workshop but please wait until as close to the workshop date as possible in case we make any more changes to these between now and then.
- Download Script -- In the first two hours of the workshop, this script will be used to demonstrate the use of R within the context of size structure analyses. You should download this material (right-click link and either "Save As ...", "Save File As ...", "Save Target As ...", or "Save Link as" depending on your browser) to the folder you created above.
- (Optional) Print Handout — This handout provides written details of the functions and processes for size structure analyses that will be demonstrated with the script above. You may want to print this for reference and to take notes on during the workshop.
Please contact me with any questions.
Workshop -- Part I
- R Introduction "Lecture" -- Introduction to basic R concepts and methods for size structure analyses with Sawyer County Raw Fish Data pulled from the Fisheries Management Database. Participants may follow along "live" with the R script or on the detailed R handout downloaded before the workshop (as described above).
Workshop -- Part II
- Track 1 - R Introduction "Hands-On" -- Participants will develop proficiency with R for size structure analysis of Raw Fish Data from the Fisheries Management Database by completing this exercise.
- Track 2 - Plotting in R -- Participants will learn to construct plots in R using base R and ggplot2 functions. All examples and exercises will use Raw Fish Data from the Fisheries Management Database. Instruction will follow this handout (which uses this R script).
Follow-Up
- Please complete this survey regarding the R Introduction portion of the workshop.
- Following the course, please feel free to contact me if you have any questions.
Useful Websites
- fishR
- Introductory Fisheries Analyses with R Book
- Learning Resources — Reference Card, data wrangling cheatsheet, Quick-R, Cookbook for R
- General Help — StackOverflow - General R and ggplot2
- ggplot2 and graphing -- ggplot2 reference, R graph catalog
- Color-related — colorBrewer, named colors, color palette cheatsheet