remove_diurnal_cycle: Remove diurnal cycle

View source: R/remove_diurnal_cycle.R

remove_diurnal_cycleR Documentation

Remove diurnal cycle

Description

Removes the mean diurnal (or other periodic) cycle by subtracting the average value for each time period (hour, month, or day). The grouping is based on a time column.

Usage

remove_diurnal_cycle(data, cols = NULL, date_col = NULL,
                     by = "hour", verbose = FALSE)

Arguments

data

A data frame with a time column.

cols

Column indices or names to adjust.

date_col

Time column index or name.

by

Period for cycle removal: "hour", "month", or "day".

verbose

Logical; if TRUE, prints progress message.

Value

A data frame with diurnal cycle removed.

Examples

remove_diurnal_cycle(data[1:200, c(1, 4, 17:19)], cols = 3:5, date_col = 1, by = "hour")

dataprep documentation built on Oct. 1, 2026, 5:07 p.m.