knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

1. Installation

Let's begin by loading the wcfish package and its dependencies.

# Load package
library(wcfish)
library(tidyverse)

2. Datasets

The package includes the following West Coast fisheries datasets (listed below):

Coastwide datasets

California (CDFW) datasets

PACFIN datasets

Other West Coast fisheries datasets

3. Inspecting datasets

Every dataset is documented with metadata. To view the metadata for a dataset, use the ? command. For example, if you wanted to look at the meta-data for the cdfw_ports dataset, you would do the following:

# Examine the metadata for the cdfw_port dataset
?cdfw_ports

This will pop up a description of the dataset and its columns in the "Help" screen of your R text editor.

4. Saving the dataset as an object

You can save the dataset as an object in your R environment using the assingment operator:

# Save a dataset in your R environment
data <- wcfish::cdfw_ports

5. Preparing a quick plot of the dataset

We encourage you to work with the data and plot it based on your own needs. However, we also provide a plot_data function for generating a quick plot of the dataset of interest. Note that this only works for the CDFW datasets.

# Quickly plot a CDFW dataset
wcfish::plot_data("cdfw_ports")


cfree14/wcfish documentation built on July 20, 2024, 7:50 p.m.