qc_as_timestamp: Convert known bad formats to correct TIMESTAMP format and set...

Description Usage Arguments Details Value Timezone See Also

Description

Converting known bad TIMESTAMP formats to POSIXt and setting the correct timezone

Usage

1
qc_as_timestamp(data, env_md, parent_logger = "test")

Arguments

data

Data frame containing TIMESTAMP variable. Also it can be a vector with TIMESTAMP values

env_md

Data frame containing the environmental metadata, in order to obtain the timezone information

Details

When loading data from csv files, depending on the office version and workflow to introduce TIMESTAMP and data, TIMESTAMP can result in the wrong format (lost of seconds, for example). This function checks for known formatting errors and try to fix them.

Value

An object of the same type of input (data frame or vector) with the fixed values of TIMESTAMP. If TIMESTAMP is already in format, a message appears and none fix is made, returning data as entered. If TIMESTAMP can not be fixed, an error is raised.

Timezone

This function also set the timezone attribute to the POSIXt TIMESTAMP. It uses qc_get_timezone and qc_set_timezone functions internally to get the timezone from the env_time_zone variable, transforming it to a compatible timezone name and set it as a POSIXt attribute.

See Also

Other Data Loading Functions: dl_data_col_classes, dl_data, dl_dec_char_detect, dl_get_si_code, dl_metadata, dl_na_char_generator, remove_dupcols


sapfluxnet/sapfluxnetQC1 documentation built on May 29, 2019, 1:50 p.m.