expand_addl: expand rows that correspond to addl records

View source: R/expand_addl.R

expand_addlR Documentation

expand rows that correspond to addl records

Description

expand rows that correspond to addl records

Usage

expand_addl(.df, ii_scale = 3600, time_related_cols = NULL)

Arguments

.df

dataframe to process

ii_scale

scaling factor to expand addl columns by. Defaults to 3600

time_related_cols

column name and scaling factor for time-dependent columns

Details

scaling factor needed to figure out units to increment the time column by, based on the TIME column. Given time in date-time format, default unit of incrementation is seconds, so the ii_scale should be 3600 for II given in hours.

Given a Time in hours and II in hours, the ii_scale would be 1.

time_related_cols should be a named vector, where the name corresponds to the column and the value is the scaling factor to scale the increment column by. Eg, given II records in days and an additional column AGEYRS, while expanding addl records, this must also be appropriately incremented in year increments. In the case of having a TIME variable in days, the time_related_cols value represents the scaling factor so time_related_cols = c("AGEYRS" = 1/365)


qPharmetra/PMDatR documentation built on April 7, 2024, 5:42 p.m.