byGridCell_CreateSFDataset: Create a map layer with values by grid cell

View source: R/byGridCell_CreateSFDataset.R

byGridCell_CreateSFDatasetR Documentation

Create a map layer with values by grid cell

Description

Function to create a map layer with values by grid cell.

Usage

byGridCell_CreateSFDataset(
  dfr,
  roms_grid,
  dataID = "gridCellID",
  join_type = c("right join", "left join", "inner join", "full join")
)

Arguments

dfr

- dataframe with values to create map layer by gridCellID

roms_grid

- ROMS grid name, path to shapefile, or sf dataframe with grid polygons by ID

dataID

- column name for grid cell ids in input dataframe

join_type

- join type for dfr joined to roms_grid

Details

Uses getGrid if roms_grid is the name of a ROMS grid. Uses readShapefile if roms_grid is a shapefile.

The results depend on the join type:

- right join: matched rows in dfr, all rows in roms_grid

- left join: all rows in dfr, matched rows in roms_grid

- inner join: only rows in dfr matched to roms_grid

- full join: all rows in dfr and all rows in roms_grid

Value

an sf (simple features) dataframe with the values by grid cell.


wStockhausen/rDisMELS documentation built on March 27, 2022, 1 a.m.