add_in_area: Take set count data for a species and add column indicating...

View source: R/calc-iphc-ser-area.R

add_in_areaR Documentation

Take set count data for a species and add column indicating whether or not it is inside a given area

Description

See example and the vignette.

Usage

add_in_area(set_counts_of_sp, area = HG_herring_pred_area)

Arguments

set_counts_of_sp

input tibble of the species of interest, likely generated from cache_pbs_data_iphc (which seems to save a list with the first element the desired tibble), with column names year, station, lat, lon, E_it, N_it, C_it, E_it20, N_it20, C_it20, usable, and in_area if indicate_in_area is TRUE

area

data.frame of (PBSmapping) class PolySet with column names PID, SID, POS, X, Y,

Value

tibble of set_counts_of_sp with extra logical column in_area to say whether or not each set is within area. Internally a column EID is created to assign each set-year a unique ID, needed for PBSmapping::findPolys, but this is not returned.

Author(s)

Andrew Edwards

Examples

## Not run: 
sp_set_counts_with_area <- add_in_area(yelloweye_rockfish$set_counts,
                                       HG_herring_pred_area)
# Gives a warning about hole vertices, can ignore.

## End(Not run)

pbs-assess/gfiphc documentation built on July 4, 2023, 1:13 p.m.