Converts a tidy dataframe containing data and metadata from one device into a sts object.

The required metadata columns in the provided tidy dataframe are as follows:

  • deviceID -- device identifier (character, non-numeric)

  • longitude -- decimal degrees E

  • latitude -- decimal degrees N

  • countryCode -- ISO 3166-1 alpha-2

  • stateCode -- ISO 3166-2 alpha-2

  • timezone -- Olson time zone

Data stored in these columns will be put in the meta dataframe of the resulting sts object.

The required data columns are as follows:

  • datetime -- measurement time (UTC)

These columns along with any other numeric columns in the tidy dataframe will be put in the data dataframe of the resulting sts object.

If the column names in 'tidyDF' do not match the names of the required columns, they can be mapped to the correct column names with the 'nameMapping' parameter.

For example, to map columns 'lon' and 'lat' in 'tidyDF' to 'longitude' and 'latitude', 'nameMapping' can be defined as nameMapping = list("lon" = "longitude", "lat" = "latitude")

sts_fromTidyDF(tidyDF = NULL, nameMapping = NULL)

Arguments

tidyDF

Tidy dataframe containing data and metadata.

nameMapping

List mapping columns in tidyDF to the required columns specified below

Value

A sts object containing data and metadata from the original tidy dataframe

Examples

library(MazamaTimeSeries) # TODO: write example for sts_fromTidyDF()