timeline: timeline

Description Usage Arguments Value Examples

View source: R/timeline.R

Description

A function for creating data for a timeline plot

Usage

1
2
timeline(dat, trange = NULL, summarize = "n", ycol = NULL,
  step = 15, units = "mins", time_zone = "UTC")

Arguments

dat

tibble, must have column t of times. If "summarize" is not "n", needs a column whose name will be passed as "ycol", and if "summarize" is "weighted.mean", also a column of weights "w".

trange

range of times. If NULL, will be inferred from data.

summarize

one of the following strings: "n","n_distinct","sum", "mean", "weighted.mean", "median","max", to apply to ycol.

ycol

name of the column with values to summarize. If "summarize" is "n", may be left NULL.

step

numeric, timestep to use in binning.

units

character, units for step, as in difftime(), e.g. 'mins' or 'days'.

time_zone

time zone.

Value

a tibble with columns t (bin-end times), n (value)

Examples

1
#

rushkin/bitsandends documentation built on Oct. 21, 2020, 11:43 a.m.