bind.summarised_result: Bind two or summarised_result objects

View source: R/methodBind.R

bind.summarised_resultR Documentation

Bind two or summarised_result objects

Description

Bind two or summarised_result objects

Usage

## S3 method for class 'summarised_result'
bind(...)

Arguments

...

summarised_result objects

Value

A summarised_result object the merged objects.

Examples

library(omopgenerics)
library(dplyr, warn.conflicts = FALSE)

cdm <- cdmFromTables(
  tables = list(
    "person" = tibble(
      person_id = c(1, 2, 3), gender_concept_id = 0, year_of_birth = 1990,
      race_concept_id = 0, ethnicity_concept_id = 0
    ),
    "observation_period" = tibble(
      observation_period_id = 1:3, person_id = 1:3,
      observation_period_start_date = as.Date("2000-01-01"),
      observation_period_end_date = as.Date("2023-12-31"),
      period_type_concept_id = 0
    )
  ),
  cdmName = "mock",
  cohortTables = list("cohort1" = tibble(
    cohort_definition_id = 1,
    subject_id = 1:3,
    cohort_start_date = as.Date("2010-01-01"),
    cohort_end_date = as.Date("2010-01-05")
  ))
)

result1 <- summary(cdm)
result2 <- summary(cdm$cohort1)

mergedResult <- bind(result1, result2)
mergedResult


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