Converts a sts object to a single, tidy
dataframe containing all varaibles from sts$data
along with
values from sts$meta
as specified in metaColumns
:
Replicating time-invariant spatial metadata for every record greatly inflates
the size of the data but also makes it much more useful when working with the
dplyr and ggplot2
packages.
Tidy dataframes constructed in this manner be combined with
dplyr::bind_rows()
and used to create multi-sensor plots.
sts_toTidyDF( sts = NULL, metaColumns = c("deviceDeploymentID", "locationName", "longitude", "latitude"), sizeMax = 100 )
sts | sts object to convert. |
---|---|
metaColumns | Spatial metadata to include in the tidy dataframe |
sizeMax | Maximum allowable size (in MB) for the resulting dataframe. |
Tidy dataframe containing data and metadata.
if (FALSE) { library(MazamaTimeSeries) # A look at the 'sts' object dplyr::glimpse(example_sts) # Now add default spatial metadata tidyDF <- sts_toTidyDF(example_sts) dplyr::glimpse(tidyDF) }