inventory_table: Create Inventory Table

View source: R/inventory_table.R

inventory_tableR Documentation

Create Inventory Table

Description

Returns a table for each cell in a climatic data frame with an indicator to show whether the corresponding cell value is missing or observed.

Usage

inventory_table(
  data,
  date_time,
  elements,
  station = NULL,
  year = NULL,
  month = NULL,
  day = NULL,
  missing_indicator = "M",
  observed_indicator = "X"
)

Arguments

data

data.frame The data.frame to calculate from.

date_time

Date The name of the date column in data.

elements

character The name of the elements column in data to apply the function to.

station

character(1) The name of the station column in data, if the data are for multiple station. The inventory table is calculated separately for each station.

year

character(1) The name of the year column in data. If NULL it will be created using lubridate::year(data[[date_time]]).

month

character(1) The name of the month column in data. If NULL it will be created using lubridate::month(data[[date_time]]).

day

character(1) The name of the day column in data. If NULL it will be created using lubridate::day(data[[date_time]]).

missing_indicator

character(1) Indicator to give if the data is missing. Default "M".

observed_indicator

character(1) Indicator to give if the data is observed. Default "X".

Value

A data.frame indicating if the value is missing or observed.

Examples

# Create inventory table for maximum and minimum temperature
inventory_table(data = daily_niger, date_time = "date", elements = c("tmax", "tmin"),
                station = "station_name")

IDEMSInternational/cdms.products documentation built on July 7, 2023, 10:13 a.m.