do_count_comparison: Tabulate two separate Yes/No counts and merge together.

Description Usage Arguments Value

View source: R/do_count_comparison.R

Description

Perform two separate tabulation of Yes/No entries in one or more columns, for two separate groups. Then merge these groups based on a specific variable. Use this where Yes/No counts for the same measurements are done at different timepoints (e.g., planned invasive surgery and actual invasive surgery).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
do_count_comparison(
  this_data,
  group1_variables,
  group1_column = "Yes",
  group1_name = "Group1",
  group2_variables,
  group2_column = "Yes",
  group2_name = "Group2",
  join_col = "variable",
  this_function = NA,
  key_for_variables = glossary.key
)

Arguments

this_data

The tibble in which the column exists.

group1_variables

The variable to use for the first group.

group1_column

The column of interest for the first group (default="Yes").

group1_name

The name of the first group (default="Group1").

group2_variables

The variable to use for the second group.

group2_column

The column of interest for the second group (default="Yes").

group2_name

The name of the second group (default="Group1").

join_col

The column to use to merge (default="variable").

this_function

A label for error/warning messages (by default it is the name of this function).

key_for_variables

Glossary to use for parameters.

Value

The merged summarised counts.


LisaHopcroft/CTutils documentation built on Oct. 7, 2021, 11:08 p.m.