Learn R Programming

Wats (version 1.0.1)

augment_cycle_data: Calculates variables necessary for WATS Plots

Description

Calculates variables necessary for WATS Plots. This the first of two functions that needs to be called to produce WATS Plots. annotate_data() is the second.

Usage

augment_year_data_with_month_resolution(ds_linear, date_name)
augment_year_data_with_second_resolution(ds_linear, date_name)

Value

Returns a tibble::tibble with additional variables: cycle_tally, proportion_through_cycle, proportion_id, and terminal_point_in_cycle.

Arguments

ds_linear

The data.frame to containing the detailed data.

date_name

The variable name in ds_linear containing the date or datetime value.

Examples

Run this code
library(Wats)
ds_linear <-
  Wats::county_month_birth_rate_2005_version |>
  dplyr::filter(county_name == "oklahoma") |>
  augment_year_data_with_month_resolution(date_name = "date")

head(ds_linear)

Run the code above in your browser using DataLab