Learn R Programming

pacheck (version 0.2.2)

check_sum_vars: Check sum variables

Description

This function tests whether the sum of selected variables are equal to another.

Usage

check_sum_vars(..., df, outcome, digits = 3)

Value

A string.

Arguments

...

character vector. This character vector contains the name of the variables of which the sum will be checked.

df

a dataframe.

outcome

character string. Name of variable of the dataframe which should equal the sum of variables mentioned in `...`.

digits

Define the number of digits at which the sum and the `outcome` variables are rounded. Default is 3 digits.

Examples

Run this code
# Checking whether health state and adverse event costs equal the total discounted costs
check_sum_vars("t_costs_pfs_d_int", "t_costs_pd_d_int", "t_costs_ae_int",
               df = head(df_pa),
               outcome = "t_costs_d_int",
               digits = 0)

Run the code above in your browser using DataLab