combine_rows_by_tol: Combine data frame rows by tolerance on a value

View source: R/dataframe_utilities.R

combine_rows_by_tolR Documentation

Combine data frame rows by tolerance on a value

Description

Combine data frame rows by tolerance on a value

Usage

combine_rows_by_tol(df, values = "TIME", tol = 0, ...)

Arguments

df

A dataframe object

values

the quoted name of the column on which to combine rows

tol

The tolerance within value in which to combine rows

...

Summary function to adjust or create columns within the combined row

Value

the modified dataframe

Examples

set.seed(12345)
vals = runif(100,0,100)
vals = vals[order(vals)]
data1 = data.frame(TIME=vals, SEX=sample(x=0:1,size = 100,replace=TRUE), AMT=100)
# make groups where start is within tol=0.5
combine_rows_by_tol(data1, values="TIME", tol=0.5, AMT=sum(AMT))

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