newSummarisedResult: 'summarised_results' object constructor

View source: R/classSummarisedResult.R

newSummarisedResultR Documentation

'summarised_results' object constructor

Description

'summarised_results' object constructor

Usage

newSummarisedResult(x, settings = attr(x, "settings"))

Arguments

x

Table.

settings

Settings for the summarised_result object.

Value

A summarised_result object

Examples

library(dplyr)
library(omopgenerics)

x <- tibble(
 "result_id" = 1L,
 "cdm_name" = "cprd",
 "group_name" = "cohort_name",
 "group_level" = "acetaminophen",
 "strata_name" = "sex &&& age_group",
 "strata_level" = c("male &&& <40", "male &&& >=40"),
 "variable_name" = "number_subjects",
 "variable_level" = NA_character_,
 "estimate_name" = "count",
 "estimate_type" = "integer",
 "estimate_value" = c("5", "15"),
  "additional_name" = "overall",
  "additional_level" = "overall"
) |>
  newSummarisedResult()

x
settings(x)
summary(x)

x <- tibble(
 "result_id" = 1L,
 "cdm_name" = "cprd",
 "group_name" = "cohort_name",
 "group_level" = "acetaminophen",
 "strata_name" = "sex &&& age_group",
 "strata_level" = c("male &&& <40", "male &&& >=40"),
 "variable_name" = "number_subjects",
 "variable_level" = NA_character_,
 "estimate_name" = "count",
 "estimate_type" = "integer",
 "estimate_value" = c("5", "15"),
  "additional_name" = "overall",
  "additional_level" = "overall"
) |>
  newSummarisedResult(settings = tibble(
    result_id = 1L, result_type = "custom_summary", mock = TRUE, value = 5
  ))

x
settings(x)
summary(x)


omopgenerics documentation built on Sept. 30, 2024, 9:16 a.m.