Blue Crab Landings Pivot
- Data: Annual Blue Crab Landings from 1950 to 2016 by State
- Source: NOAA’s National Marine Fisheries Service
- What are Blue Crab “Landings”?
- Blue Crabs caught and brought to “Land”
- Excludes those caught but returned to the water (juveniles, etc.)
- THIS IS INTERACTIVE!
- Recommendations if unfamiliar with pivoting:
- General Tip: scroll down in your browser before selecting
- You need to see the bottom of dropdown lists (to click “Apply”)
- If you have any problems, just refresh your browser to reset
- Now, where you see “Table” (below/left), select “Stacked Bar Chart”
- Next, from “State” dropdown in the blue area, select some States
- Same deal with “Year” in the other blue area
- Lots more options, feeling ambitious?
- Switch from “Stacked Bar Chart” back to “Table” (or just refresh)
- Now drag the “Region” box from the gray area & drop below “State”
- Next drag & drop “State” to the gray area where “Region” was
- Then, with “State” still in the gray area, select whichever
- See the regional totals change? Get the idea? Go have at it…
library(rpivotTable)
datums <- read.csv("~/Jeff/rSpace/Data/crabDatums1950To2016.csv")
rpivotTable(datums, rows = "State", cols = "Year", aggregatorName = "Sum",
vals = "PoundsMillion", rendererName = "Table",
inclusions = list(Year = as.list(as.character(c(2007:2016))),
State = list("LA", "MD", "NC", "VA")))