assignment_column: Assign observations to zone or area person("Melanie",...

View source: R/assignment_column.r

assignment_columnR Documentation

Assign observations to zone or area person("Melanie", "Harsch", role = c("aut"))

Description

Assign observations to zone or area person("Melanie", "Harsch", role = c("aut"))

Usage

assignment_column(
  dat,
  gridfile,
  hull.polygon,
  lon.dat,
  lat.dat,
  categ,
  closest.pt,
  lon.grid,
  lat.grid
)

Arguments

dat

Main data frame containing data on hauls or trips. Table in fishset_db database should contain the string 'MainDataTable'.

gridfile

Spatial data. Shape, json, and csv formats are supported.

hull.polygon

T/F If TRUE, creates convex hull polygon. Use if spatial data creating polygon are sparse or irregular.

lon.dat

Column containing longitude data in main data frame.

lat.dat

Column containing latitude data in main data frame.

categ

Column in gridfile that identifies the individual areas or zones. If gridfile is class sf, 'categ' should be name of list containing information on zones.

closest.pt

TRUE/FALSE If true, zone ID identified as the closest polygon to the point.

lon.grid

If gridfile is not shape or json file, specify column containing longitude data in gridfile.

lat.grid

If gridfile is not shape or json file, specify column containing latitude data in gridfile.

Details

Assign each observation to zones defined by a spatial data set. Converts point data from gridfile into polygons and then finds which polygon each observation in the main data frame is within. Use hull.polygon=T if data is sparse or irregular.

Value

Main data frame with new assignment column labeled zoneID.


allen-chen-noaa-gov/barebones.FishSET documentation built on March 1, 2024, 8:19 a.m.