create_data_values: Create the DataValues table

View source: R/create_data_values.R

create_data_valuesR Documentation

Create the DataValues table

Description

Create the DataValues table

Usage

create_data_values(
  L0_flat,
  ValueID,
  DataValue,
  ValueAccuracy = NULL,
  LocalDateTime,
  UTCOffset,
  DateTimeUTC = NULL,
  SiteCode,
  VariableCode,
  OffsetValue = NULL,
  OffsetTypeCode = NULL,
  CensorCode = NULL,
  QualifierCode = NULL,
  MethodCode,
  QualityControlLevelCode,
  SourceCode,
  NoDataValue
)

Arguments

L0_flat

(tbl_df, tbl, data.frame) The fully joined source L0 dataset, in "flat" format (see details).

ValueID

(character) Column in L0_flat containing the identifier assigned to each unique data value.

DataValue

(character) Column in L0_flat containing the numeric value of the observation.

ValueAccuracy

(character) Optional. Column in L0_flat containing the umeric value that describes the measurement accuracy of the data value.

LocalDateTime

(character) Column in L0_flat containing local date and time at which the data value was observed.

UTCOffset

(character) Column in L0_flat containing offset in hours from UTC time of the corresponding LocalDateTime value.

DateTimeUTC

(character) Column in L0_flat containing UTC date and time at which the data value was observed.

SiteCode

(character) Column in L0_flat containing code used by organization that collects the data to identify the site.

VariableCode

(character) Column in L0_flat containing code used by the organization that collects the data to identify the variable.

OffsetValue

(character) Optional. Column in L0_flat containing distance from a datum or control point to the point at which a data value was observed.

OffsetTypeCode

(character) if OffsetValue is used. Column in L0_flat containing code used by the organization that collects the data to identify the OffsetType.

CensorCode

(character) Column in L0_flat containing text indication of whether the data value is censored. Defaults to "nc" (Not Censored).

QualifierCode

(character) Optional. Column in L0_flat containing a flag indicating a peculiarity with a particular data value.

MethodCode

(character) Column in L0_flat containing the code used by the organization that collects the data to identify the Method.

QualityControlLevelCode

(character) Column in L0_flat containing the code which identifies the level of quality control that the value has been subjected to.

SourceCode

(character) Column in L0_flat containing the code which identifies the organization that created the data.

NoDataValue

(character) Column in L0_flat containing numeric value used to encode when a data value is not available for this variable.

Details

This function appends columns to the L0_flat table and returns the augmented table.

"flat" format refers to the fully joined source L0 dataset in "wide" form with the exception of the core observation variables, which are in "long" form (i.e. using the variable_name, value, unit columns of the observation table). This "flat" format is the "widest" an L1 hymetDP dataset can be consistently spread due to the frequent occurrence of L0 source datasets with > 1 core observation variable.

Value

(tbl_df, tbl, data.frame) The DataValues table.

See Also

Other create required tables: create_methods(), create_quality_control(), create_series_catalog(), create_sites(), create_sources(), create_variables()

Examples


flat <- hymet_L0_flat

  DataValues <- hymetDP::create_data_values(
    L0_flat = flat,
    ValueID = "ValueID",
    DataValue = "DataValue",
    ValueAccuracy = NULL,
    LocalDateTime = "LocalDateTime",
    UTCOffset = "UTCOffset",
    DateTimeUTC = "DateTimeUTC",
    SiteCode = "SiteCode",
    VariableCode = "VariableCode",
    OffsetValue = NULL,
    OffsetTypeCode = NULL,
    CensorCode = NULL,
    QualifierCode = NULL,
    MethodCode = "MethodCode",
    QualityControlLevelCode = "QualityControlLevelCode",
    SourceCode = "SourceCode",
    NoDataValue = "NoDataValue")

  DataValues


kzollove/hymetDP documentation built on Nov. 22, 2022, 10:41 p.m.