library(rfisheries)
library(dplyr)
species <- of_species_codes()
who <- c("TUX", "COD", "VET", "NPA")
by_species <- lapply(who, function(x) of_landings(species = x)) %>% rbind_all
library(ggplot2)
ggplot(by_species, aes(year, catch)) +
geom_line(size = 1.2) +
facet_wrap(~species, scales = "free_y")
Created
August 10, 2015 14:06
-
-
Save karthik/e6de40d6a20bb9f2fd52 to your computer and use it in GitHub Desktop.
Reproducible example of fisheries data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ```{r echo=FALSE} | |
| knitr::opts_knit$set(upload.fun = imgur_upload, base.url = NULL) | |
| ``` | |
| ```{r} | |
| library(rfisheries) | |
| library(dplyr) | |
| species <- of_species_codes() | |
| who <- c("TUX", "COD", "VET", "NPA") | |
| by_species <- lapply(who, function(x) of_landings(species = x)) %>% rbind_all | |
| library(ggplot2) | |
| ggplot(by_species, aes(year, catch)) + | |
| geom_line(size = 1.2) + | |
| facet_wrap(~species, scales = "free_y") | |
| ``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
