smoothData: Smooth one column of a dataframe that has time nested in...

View source: R/rtiesShared.R

smoothDataR Documentation

Smooth one column of a dataframe that has time nested in people (e.g., the function is applied one person at a time) with a user specified smoothing window

Description

Smooth one column of a dataframe that has time nested in people (e.g., the function is applied one person at a time) with a user specified smoothing window

Usage

smoothData(basedata, window, personId, obs_name)

Arguments

basedata

A user provided dataframe.

window

A number specifying the window size to be smoothed over.

personId

The variable in the dataframe specifying person ID.

obs_name

The name of the column in the dataframe that has the time-varying observable (e.g., the variable that will be smoothed).

Value

The original dataframe with an additional column holding the smoothed observation variable, called "obsSmooth"


ebmtnprof/rties documentation built on Aug. 25, 2022, 7:47 p.m.