byGridCell_GridOps: Perform a mathematical operation on values by grid cell in...

View source: R/byGridCell_GridOps.R

byGridCell_GridOpsR Documentation

Perform a mathematical operation on values by grid cell in one or two dataframes

Description

Function to perform a mathematical operation on values by grid cell in one or two dataframes.

Usage

byGridCell_GridOps(
  dfr1,
  op,
  dfr2 = NULL,
  cols = c("unsuccessful_indivs", "successful_indivs", "total_indivs",
    "unsuccessful_abundance", "successful_abundance", "total_abundance"),
  gridCellID = "gridCellID"
)

Arguments

dfr1

- dataframe with results by grid cell

op

- operation by grid cell ("+","-","*","/","sqrt")

dfr2

- dataframe with results by grid cell (ignored if op="sqrt")

cols

- dataframe column names to apply operation to

gridCellID

- column name (as string) for grid cell IDs (default="gridCellID")

Details

"Factor" levels (gridCellID, startTime) in dataframes must be aligned, each must have the same number of rows. Columns in dataframe not specified in cols are returned unchanged.

Note that dfr1 and dfr2 could also be tibbles or sf datasets. The returned type will be that of dfr1.

Value

dataframe with results of operation in requested columns.


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