tidyTimelines: Apply 'tidy' data principles to the timeline histogram data...

View source: R/tidyTimelines.R

tidyTimelinesR Documentation

Apply 'tidy' data principles to the timeline histogram data stream

Description

tidyTimelines returns a 'tidy'd' data frame of timeline data

Usage

tidyTimelines(histos, row_min = 1)

Arguments

histos

a list returned from read_histos

row_min

user defined minimum timeline records required; row_min = 2 will return NULL unless at least 1 records are found.

Details

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.

Value

a data frame with tidy, narrow data structure and actual time periods in place of bins


jmlondon/wcUtils documentation built on March 19, 2024, 8:40 a.m.