View source: R/tidyTimelines.R
tidyTimelines | R Documentation |
tidyTimelines
returns a 'tidy'd' data frame of timeline data
tidyTimelines(histos, row_min = 1)
histos |
a list returned from |
row_min |
user defined minimum timeline records required; |
The histogram data stream is provided in a 'wide' format (each row represents
a time period and the observed values are provided in 1 to 72 'bin' columns).
This format can be difficult to work with in R and other data analysis
platforms (e.g. database tables), so we use the tidyr
and dplyr
packages to manipulate the data into a more flexible, 'narrow' format. This
results in a data structure where every row represents a single observation.
This is implemented, here, with the timeline data. For timeline data, tag 'dryness' is provided as either a percentage of each hour the tag was dry or as a binary (1 or 0) value representing whether a tag was dry for a majority of a given 20-minute period. For both of these situations, the values for the 'bin' columns are predictable and we can, in addition to tidying the data structure, also turn the bin values into actual time periods.
a data frame with tidy, narrow data structure and actual time periods in place of bins
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.