calculate_number_of_instances: Calculate number of instances

Description Usage Arguments Value

View source: R/calculate_number_of_instances.R

Description

This function returns the number of non-empty entries, optionally for each patient and each timepoint. Ensure that the tibble provided includes ALL rows (i.e., this is the extended form of the data from MACRO, with lots of empty values). If grouping by timepoint is specified, the data will be returned with the timepoints spread as columns.

Usage

1
2
3
4
5
6
7
8
calculate_number_of_instances(
  this_data,
  this_var,
  patient_column = NULL,
  timepoint_column = NULL,
  spread_timepoints = TRUE,
  this_function = NA
)

Arguments

this_data

The tibble in which the column exists

this_var

The column name (if not a quosure, it will be made into one)

patient_column

The column name containing the patient ID to group by (default is to not group)

timepoint_column

The column name containing the timepoint to group by (default is to not group)

spread_timepoints

A column to spread the results by timepoint (default is TRUE)

this_function

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

Value

tibble containing the patient and their tumour counts for each timepoint.


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