summariseResult: Summarise variables using a set of estimate functions. The...

View source: R/summariseResult.R

summariseResultR Documentation

Summarise variables using a set of estimate functions. The output will be a formatted summarised_result object.

Description

Summarise variables using a set of estimate functions. The output will be a formatted summarised_result object.

Usage

summariseResult(
  table,
  group = list(),
  includeOverallGroup = FALSE,
  strata = list(),
  includeOverallStrata = TRUE,
  variables = NULL,
  estimates = c("min", "q25", "median", "q75", "max", "count", "percentage"),
  counts = TRUE
)

Arguments

table

Table with different records.

group

List of groups to be considered.

includeOverallGroup

TRUE or FALSE. If TRUE, results for an overall group will be reported when a list of groups has been specified.

strata

List of the stratifications within each group to be considered.

includeOverallStrata

TRUE or FALSE. If TRUE, results for an overall strata will be reported when a list of strata has been specified.

variables

Variables to summarise, it can be a list to point to different set of estimate names.

estimates

Estimates to obtain, it can be a list to point to different set of variables.

counts

Whether to compute number of records and number of subjects.

Value

A summarised_result object with the summarised data of interest.

Examples


library(PatientProfiles)
library(dplyr)

cdm <- mockPatientProfiles()
x <- cdm$cohort1 %>%
  addDemographics() %>%
  collect()
result <- summariseResult(x)
mockDisconnect(cdm = cdm)



PatientProfiles documentation built on Oct. 30, 2024, 9:13 a.m.