Skip to content

Update README file to provide examples and metadata #1

Description

@kstierhoff

Suggestions for ease of use I have are to flesh out the README a bit, mostly just to have the information you provided me up there. A couple of things that would be especially helpful:

  • An example usage to pull data, with the information you provided me above on how to interpret the file names. More or less the R script that you sent me
  • Some metadata on the column names
# Example code ----------------------------------
# Install and load pak (library management package)
if (!require("pak")) install.packages("pak")

# Install and load data package from Github -------------------------------
if (!require("atmData")) pkg_install("SWFSC/atmData")
if (!require("tidyverse")) pkg_install("tidyverse")

# Load data from 2024
## Biomass densities
data("nasc_density_2407RL")

# Quick plot of biomass density from 2024
## Sardine density
ggplot(nasc_density_2407RL, aes(long, lat, size = sar.dens, colour = sar.dens)) +
  scale_colour_viridis_c() +
  guides(colour = guide_legend(), size = guide_legend()) +
  geom_point() + 
  facet_wrap(~Region) +
  coord_map() + 
  labs(title = "P. sardine")

## Anchovy density
ggplot(nasc_density_2407RL, aes(long, lat, size = anch.dens, colour = anch.dens)) +
  scale_colour_viridis_c() +
  guides(colour = guide_legend(), size = guide_legend()) +
  geom_point() + 
  facet_wrap(~Region) +
  coord_map() + 
  labs(title = "N. anchovy")

# Reshape data to plot all species
nasc_dens_longer <- nasc_density_2407RL %>% 
  select(lat, long, Region, anch.dens:rher.dens) %>% 
  pivot_longer(anch.dens:rher.dens, names_to = "species", values_to = "density")

## All species density
ggplot(nasc_dens_longer, aes(long, lat, size = density, colour = density)) +
  scale_colour_viridis_c() +
  guides(colour = guide_legend(), size = guide_legend()) +
  geom_point() + 
  facet_grid(Region~species) +
  coord_map()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions