Type: | Package |
Title: | Pretest Probability for Coronary Artery Disease |
Version: | 1.1.0 |
Maintainer: | Jeremy Selva <jeremy1189.jjs@gmail.com> |
Description: | An application to calculate a patient's pretest probability (PTP) for obstructive Coronary Artery Disease (CAD) from a collection of guidelines or studies. Guidelines usually comes from the American Heart Association (AHA), American College of Cardiology (ACC) or European Society of Cardiology (ESC). Examples of PTP scores that comes from studies are the 2020 Winther et al. basic, Risk Factor-weighted Clinical Likelihood (RF-CL) and Coronary Artery Calcium Score-weighted Clinical Likelihood (CACS-CL) models <doi:10.1016/j.jacc.2020.09.585>, 2019 Reeh et al. basic and clinical models <doi:10.1093/eurheartj/ehy806> and 2017 Fordyce et al. PROMISE Minimal-Risk Tool <doi:10.1001/jamacardio.2016.5501>. As diagnosis of CAD involves a costly and invasive coronary angiography procedure for patients, having a reliable PTP for CAD helps doctors to make better decisions during patient management. This ensures high risk patients can be diagnosed and treated early for CAD while avoiding unnecessary testing for low risk patients. |
License: | MIT + file LICENSE |
URL: | https://github.com/JauntyJJS/pretestcad, https://jauntyjjs.github.io/pretestcad/ |
BugReports: | https://github.com/JauntyJJS/pretestcad/issues |
Depends: | R (≥ 4.1.0) |
Imports: | cli, dplyr, rlang, stringr |
Suggests: | purrr, spelling, testthat (≥ 3.0.0), tibble |
Config/testthat/edition: | 3 |
Encoding: | UTF-8 |
Language: | en-GB |
RoxygenNote: | 7.3.2 |
NeedsCompilation: | no |
Packaged: | 2025-09-03 09:52:56 UTC; Jeremy |
Author: | Jeremy Selva |
Repository: | CRAN |
Date/Publication: | 2025-09-03 11:40:02 UTC |
Match an argument to a character vector but skip NA
Description
This is equivalent to arg_match
but skip NA
Usage
arg_match0_allow_na(
arg,
values,
arg_nm = rlang::caller_arg(arg),
error_call = rlang::caller_env()
)
Arguments
arg |
A symbol referring to an argument accepting strings. |
values |
A character vector of possible values that |
arg_nm |
Same as |
error_call |
The execution environment of a currently
running function, e.g. |
Value
The string supplied to arg
.
See Also
Examples
# No error
input = "male"
arg_match0_allow_na(input, values = c("female","male"))
# Allow NA
input = NA
arg_match0_allow_na(input, values = c("female","male"))
# Error as M is not female or male
input = "emale"
try(arg_match0_allow_na(input, values = c("female","male")))
Match an argument to a integer vector but skip NA
Description
This is equivalent to arg_match
but an
integer variable is needed and skip NA
.
Usage
arg_match0_integer(
arg,
values,
allow_na = TRUE,
arg_nm = rlang::caller_arg(arg),
error_call = rlang::caller_env()
)
Arguments
arg |
A symbol referring to an argument accepting strings. |
values |
A character vector of possible values that |
allow_na |
Input boolean to determine if |
arg_nm |
Same as |
error_call |
The execution environment of a currently
running function, e.g. |
Value
The integer supplied to arg
.
Examples
# No error
input = 5
arg_match0_integer(input, values = c(0:5))
# Allow NA
input = NA
arg_match0_integer(input, values = c(0:5))
# Error as 0 is not within 0 and 5
input = 6
try(arg_match0_integer(input, values = c(0:5)))
# Error as NULL is not within 0 and 5
input = NULL
try(arg_match0_integer(input, values = c(0:5)))
# Error as NA is not within 0 and 5 and allow_na is FALSE
input = NA
try(arg_match0_integer(input, values = c(0:5), allow_na = FALSE))
Error Message For NA
Argument For Non-missing List
Description
Provides an error message if the argument provided is NA
if a non-missing list is provided
Usage
arg_match0_no_na_error_message(
arg,
values,
arg_nm = rlang::caller_arg(arg),
error_call = rlang::caller_env()
)
Arguments
arg |
A symbol referring to an argument accepting strings. |
values |
A character vector of possible values that |
arg_nm |
Same as |
error_call |
The execution environment of a currently
running function, e.g. |
Value
An error message if the argument provided is NA
if a non-missing list is provided. Else if will return NULL
invisibly,
regardless if arg
has a match with the elements in values
or not.
See Also
Examples
# Error as input is NA but value list provided has no NA
input = NA
try(arg_match0_no_na_error_message(input, values = c("female","male")))
# No error as value list provided has NA
input = NA
arg_match0_allow_na(input, values = c("female","male", NA))
# No error as input is not NA
input = "male"
arg_match0_allow_na(input, values = c("female","male", NA))
Match an argument to a TRUE
or FALSE
vector but skip NA
Description
This is equivalent to arg_match
but a
boolean variable is needed and skip NA
.
Usage
arg_match0_true_or_false(
arg,
allow_na = TRUE,
arg_nm = rlang::caller_arg(arg),
error_call = rlang::caller_env()
)
Arguments
arg |
A symbol referring to an argument accepting strings. |
allow_na |
Input boolean to determine if |
arg_nm |
Same as |
error_call |
The execution environment of a currently
running function, e.g. |
Value
The TRUE
or FALSE
value supplied to arg
.
Examples
# No error
input = TRUE
arg_match0_true_or_false(input)
# Allow NA
input = NA
arg_match0_true_or_false(input)
# Error as 0 is not TRUE or FALSE
input = 0
try(arg_match0_true_or_false(input))
# Error as 1 is not TRUE or FALSE
input = 1
try(arg_match0_true_or_false(input))
# Error as NULL is not TRUE or FALSE
input = NULL
try(arg_match0_true_or_false(input))
# Error as NA is not TRUE or FALSE and allow_na is FALSE
input = NA
try(arg_match0_true_or_false(input, allow_na = FALSE))
Calculate ACCF/AHA/ACP/AATS/PCNA/SCAI/STS 2012 PTP for obstructive CAD
Description
This function returns a patient's pre-test Probability (PTP) of obstructive coronary artery disease (CAD) based on the American College of Cardiology Foundation, American Heart Association, American College of Physicians, American Association for Thoracic Surgery, Preventive Cardiovascular Nurses Association, Society for Cardiovascular Angiography and Interventions, and Society of Thoracic Surgeons 2012 guidelines.
Usage
calculate_aha_2012_tbl_9_ptp(
age,
sex,
chest_pain_type,
output = c("numeric", "percentage"),
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
label_cpt_nonanginal = c("nonanginal"),
label_cpt_atypical = c("atypical"),
label_cpt_typical = c("typical"),
label_cpt_unknown = c(NA, NaN)
)
Arguments
age |
Input integer value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
chest_pain_type |
The value of variable in the parameters,
|
output |
Input text to indicate the how pre-test probability results be expressed Default: c("numeric", "percentage")
|
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
label_cpt_nonanginal |
Label(s) for patient having nonanginal or non-specific chest pain.
Default: |
label_cpt_atypical |
Label(s) for patient having atypical chest pain.
Default: |
label_cpt_typical |
Label(s) for patient having typical chest pain.
Default: |
label_cpt_unknown |
Label(s) for patient having unknown chest pain type symptoms.
Default: |
Details
The predictive model used to create the guidelines are based on patients from the Diamond and Forrester and the Coronary Artery Surgery Study.
Value
An integer or percentage representing the patient's PTP for obstructive CAD based on the ACCF/AHA/ACP/AATS/PCNA/SCAI/STS 2012 guidelines.
Examples
# 35 year old female with typical chest pain
calculate_aha_2012_tbl_9_ptp(
age = 35,
sex = "female",
chest_pain_type = "typical",
output = "percentage"
)
# 65 year old male with nonanginal chest pain
calculate_aha_2012_tbl_9_ptp(
age = 65,
sex = "male",
chest_pain_type = "nonanginal",
output = "percentage"
)
Calculate AHA/ACC 2021 PTP for obstructive CAD
Description
This function returns a patient's pre-test Probability (PTP) of obstructive coronary artery disease (CAD) based on the American Heart Association/American College of Cardiology (AHA/ACC) 2021 guidelines.
Usage
calculate_aha_2021_ptp(
age,
sex,
have_dyspnoea,
have_chest_pain,
output = c("grouping", "numeric", "percentage"),
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
label_have_dyspnoea_no = c("no"),
label_have_dyspnoea_yes = c("yes"),
label_have_dyspnoea_unknown = c(NA, NaN),
label_have_chest_pain_no = c("no"),
label_have_chest_pain_yes = c("yes"),
label_have_chest_pain_unknown = c(NA, NaN)
)
Arguments
age |
Input integer value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
have_dyspnoea |
The value of variable in the parameters |
have_chest_pain |
The value of variable in the parameters |
output |
Input text to indicate the how pre-test probability results be expressed Default: c("grouping", "numeric", "percentage")
|
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
label_have_dyspnoea_no |
Label(s) for patient having no dyspnoea symptoms.
Default: |
label_have_dyspnoea_yes |
Label(s) for patient having dyspnoea symptoms.
Default: |
label_have_dyspnoea_unknown |
Label(s) for patient having unknown dyspnoea symptoms.
Default: |
label_have_chest_pain_no |
Label(s) for patient not having chest pain symptoms.
Default: |
label_have_chest_pain_yes |
Label(s) for patient having chest pain symptoms.
Default: |
label_have_chest_pain_unknown |
Label(s) for patient with unknown chest pain symptoms.
Default: |
Details
The predictive model used to create the guidelines are based on patients from European countries with low cardiovascular disease (CVD) risk.
If the patient has both dyspnoea and a particular chest pain type (typical, atypical, nonanginal), The chest pain type will take precedence over dyspnoea
Value
An integer, percentage or category representing the patient's PTP for obstructive CAD
based on the AHA/ACC 2021 guidelines.
See parameter option output
for more information.
Examples
# 35 year old female with chest pain
calculate_aha_2021_ptp(
age = 35,
sex = "female",
have_dyspnoea = "no",
have_chest_pain = "yes",
output = "percentage"
)
# 75 year old male with only dyspnoea
calculate_aha_2021_ptp(
age = 75,
sex = "male",
have_dyspnoea = "yes",
have_chest_pain = "no",
output = "percentage"
)
Calculate 2011 CAD1 Basic PTP for obstructive CAD
Description
This function returns a patient's pre-test probability (PTP) of obstructive coronary artery disease based on the 2011 CAD Consortium 1 (CAD1) basic model.
Usage
calculate_cad1_2011_ptp(
age,
sex,
chest_pain_type,
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
label_cpt_nonanginal = c("nonanginal"),
label_cpt_atypical = c("atypical"),
label_cpt_typical = c("typical"),
label_cpt_unknown = c(NA, NaN)
)
Arguments
age |
Input numeric value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
chest_pain_type |
The value of variable in the parameters,
|
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
label_cpt_nonanginal |
Label(s) for patient having nonanginal or non-specific chest pain.
Default: |
label_cpt_atypical |
Label(s) for patient having atypical chest pain.
Default: |
label_cpt_typical |
Label(s) for patient having typical chest pain.
Default: |
label_cpt_unknown |
Label(s) for patient having unknown chest pain type symptoms.
Default: |
Details
The predictive model is based on patients from 14 hospitals in Europe and the United States.
This model is also called the updated Diamond-Forrester model.
Value
A numeric value representing the patient's PTP for obstructive CAD based on the 2011 CAD Consortium 1 (CAD1) basic model.
Examples
# 40 year old female with typical chest pain
calculate_cad1_2011_ptp(
age = 40,
sex = "female",
chest_pain_type = "typical"
)
Calculate 2012 CAD2 Basic PTP for obstructive CAD
Description
This function returns a patient's pre-test probability (PTP) of obstructive coronary artery disease based on the 2012 CAD Consortium 2 (CAD2) basic model.
Usage
calculate_cad2_2012_basic_ptp(
age,
sex,
chest_pain_type,
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
label_cpt_nonanginal = c("nonanginal"),
label_cpt_atypical = c("atypical"),
label_cpt_typical = c("typical"),
label_cpt_unknown = c(NA, NaN)
)
Arguments
age |
Input numeric value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
chest_pain_type |
The value of variable in the parameters,
|
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
label_cpt_nonanginal |
Label(s) for patient having nonanginal or non-specific chest pain.
Default: |
label_cpt_atypical |
Label(s) for patient having atypical chest pain.
Default: |
label_cpt_typical |
Label(s) for patient having typical chest pain.
Default: |
label_cpt_unknown |
Label(s) for patient having unknown chest pain type symptoms.
Default: |
Details
The predictive model is based on patients from 18 hospitals in Europe and the United States.
Value
A numeric value representing the patient's PTP for obstructive CAD based on the 2012 CAD Consortium 2 (CAD2) basic model.
Examples
# 40 year old female with typical chest pain
calculate_cad2_2012_basic_ptp(
age = 40,
sex = "female",
chest_pain_type = "typical"
)
Calculate 2012 CAD2 Clinical and CCS PTP for obstructive CAD
Description
This function returns a patient's pre-test probability (PTP) of obstructive coronary artery disease based on the 2012 CAD Consortium 2 (CAD2) clinical and coronary calcium score (CCS) model.
Usage
calculate_cad2_2012_clinical_ccs_ptp(
age,
sex,
chest_pain_type,
have_diabetes,
have_hypertension,
have_dyslipidemia,
have_smoking_history,
coronary_calcium_score,
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
label_cpt_nonanginal = c("nonanginal"),
label_cpt_atypical = c("atypical"),
label_cpt_typical = c("typical"),
label_cpt_unknown = c(NA, NaN),
label_have_diabetes_no = c("no"),
label_have_diabetes_yes = c("yes"),
label_have_diabetes_unknown = c(NA, NaN),
label_have_hypertension_no = c("no"),
label_have_hypertension_yes = c("yes"),
label_have_hypertension_unknown = c(NA, NaN),
label_have_dyslipidemia_no = c("no"),
label_have_dyslipidemia_yes = c("yes"),
label_have_dyslipidemia_unknown = c(NA, NaN),
label_have_smoking_history_no = c("no"),
label_have_smoking_history_yes = c("yes"),
label_have_smoking_history_unknown = c(NA, NaN)
)
Arguments
age |
Input numeric value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
chest_pain_type |
The value of variable in the parameters,
|
have_diabetes |
The value of variable in the parameters
|
have_hypertension |
The value of variable in the parameters
|
have_dyslipidemia |
The value of variable in the parameters
|
have_smoking_history |
The value of variable in the parameters
|
coronary_calcium_score |
Input non-negative numeric to indicate the total coronary calcium score of the patient. |
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
label_cpt_nonanginal |
Label(s) for patient having nonanginal or non-specific chest pain.
Default: |
label_cpt_atypical |
Label(s) for patient having atypical chest pain.
Default: |
label_cpt_typical |
Label(s) for patient having typical chest pain.
Default: |
label_cpt_unknown |
Label(s) for patient having unknown chest pain type symptoms.
Default: |
label_have_diabetes_no |
Label(s) for patient with no diabetes.
Default: |
label_have_diabetes_yes |
Label(s) for patient having diabetes.
Default: |
label_have_diabetes_unknown |
Label(s) for patient
having unknown diabetes.
Default: |
label_have_hypertension_no |
Label(s) for patient with no hypertension.
Default: |
label_have_hypertension_yes |
Label(s) for patient having hypertension.
Default: |
label_have_hypertension_unknown |
Label(s) for patient
having unknown hypertension.
Default: |
label_have_dyslipidemia_no |
Label(s) for patient with no dyslipidemia.
Default: |
label_have_dyslipidemia_yes |
Label(s) for patient having dyslipidemia.
Default: |
label_have_dyslipidemia_unknown |
Label(s) for patient
having unknown dyslipidemia.
Default: |
label_have_smoking_history_no |
Label(s) for patient with
no smoking history (current or past).
Default: |
label_have_smoking_history_yes |
Label(s) for patient having
smoking history (current or past).
Default: |
label_have_smoking_history_unknown |
Label(s) for patient
having unknown smoking history (current or past).
Default: |
Details
The predictive model is based on patients from 18 hospitals in Europe and the United States.
Value
A numeric value representing the patient's PTP for obstructive CAD based on the 2012 CAD Consortium 2 (CAD2) clinical and coronary calcium score (CCS) model.
Examples
# 40 year old female with typical chest pain,
# diabetes but no hypertension, dyslipidemia,
# a non-smoker and a coronary calcium score of 0
calculate_cad2_2012_clinical_ccs_ptp(
age = 40,
sex = "female",
chest_pain_type = "typical",
have_diabetes = "yes",
have_hypertension = "no",
have_dyslipidemia = "no",
have_smoking_history = "no",
coronary_calcium_score = 0
)
Calculate 2012 CAD2 Clinical PTP for obstructive CAD
Description
This function returns a patient's pre-test probability (PTP) of obstructive coronary artery disease based on the 2012 CAD Consortium 2 (CAD2) clinical model.
Usage
calculate_cad2_2012_clinical_ptp(
age,
sex,
chest_pain_type,
have_diabetes,
have_hypertension,
have_dyslipidemia,
have_smoking_history,
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
label_cpt_nonanginal = c("nonanginal"),
label_cpt_atypical = c("atypical"),
label_cpt_typical = c("typical"),
label_cpt_unknown = c(NA, NaN),
label_have_diabetes_no = c("no"),
label_have_diabetes_yes = c("yes"),
label_have_diabetes_unknown = c(NA, NaN),
label_have_hypertension_no = c("no"),
label_have_hypertension_yes = c("yes"),
label_have_hypertension_unknown = c(NA, NaN),
label_have_dyslipidemia_no = c("no"),
label_have_dyslipidemia_yes = c("yes"),
label_have_dyslipidemia_unknown = c(NA, NaN),
label_have_smoking_history_no = c("no"),
label_have_smoking_history_yes = c("yes"),
label_have_smoking_history_unknown = c(NA, NaN)
)
Arguments
age |
Input numeric value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
chest_pain_type |
The value of variable in the parameters,
|
have_diabetes |
The value of variable in the parameters
|
have_hypertension |
The value of variable in the parameters
|
have_dyslipidemia |
The value of variable in the parameters
|
have_smoking_history |
The value of variable in the parameters
|
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
label_cpt_nonanginal |
Label(s) for patient having nonanginal or non-specific chest pain.
Default: |
label_cpt_atypical |
Label(s) for patient having atypical chest pain.
Default: |
label_cpt_typical |
Label(s) for patient having typical chest pain.
Default: |
label_cpt_unknown |
Label(s) for patient having unknown chest pain type symptoms.
Default: |
label_have_diabetes_no |
Label(s) for patient with no diabetes.
Default: |
label_have_diabetes_yes |
Label(s) for patient having diabetes.
Default: |
label_have_diabetes_unknown |
Label(s) for patient
having unknown diabetes.
Default: |
label_have_hypertension_no |
Label(s) for patient with no hypertension.
Default: |
label_have_hypertension_yes |
Label(s) for patient having hypertension.
Default: |
label_have_hypertension_unknown |
Label(s) for patient
having unknown hypertension.
Default: |
label_have_dyslipidemia_no |
Label(s) for patient with no dyslipidemia.
Default: |
label_have_dyslipidemia_yes |
Label(s) for patient having dyslipidemia.
Default: |
label_have_dyslipidemia_unknown |
Label(s) for patient
having unknown dyslipidemia.
Default: |
label_have_smoking_history_no |
Label(s) for patient with
no smoking history (current or past).
Default: |
label_have_smoking_history_yes |
Label(s) for patient having
smoking history (current or past).
Default: |
label_have_smoking_history_unknown |
Label(s) for patient
having unknown smoking history (current or past).
Default: |
Details
The predictive model is based on patients from 18 hospitals in Europe and the United States.
Value
A numeric value representing the patient's PTP for obstructive CAD based on the 2012 CAD Consortium 2 (CAD2) clinical model.
Examples
# 40 year old female with typical chest pain,
# diabetes but no hypertension, dyslipidemia
# and a non-smoker
calculate_cad2_2012_clinical_ptp(
age = 40,
sex = "female",
chest_pain_type = "typical",
have_diabetes = "yes",
have_hypertension = "no",
have_dyslipidemia = "no",
have_smoking_history = "no"
)
Calculate Number Of Risk Factors (CONFIRM 2015)
Description
A function used to calculate the number of risk factors the patient has. This is used to calculate the pretest probability of coronary artery disease (CAD) based on the 2015 CONFIRM Risk Score.
Usage
calculate_confirm_2015_num_of_rf(
have_typical_chest_pain,
have_diabetes,
have_hypertension,
have_family_history,
is_current_smoker,
max_na = 0,
label_have_typical_chest_pain_no = c("no"),
label_have_typical_chest_pain_yes = c("yes"),
label_have_typical_chest_pain_unknown = c(NA, NaN),
label_have_diabetes_no = c("no"),
label_have_diabetes_yes = c("yes"),
label_have_diabetes_unknown = c(NA, NaN),
label_have_hypertension_no = c("no"),
label_have_hypertension_yes = c("yes"),
label_have_hypertension_unknown = c(NA, NaN),
label_have_family_history_no = c("no"),
label_have_family_history_yes = c("yes"),
label_have_family_history_unknown = c(NA, NaN),
label_is_current_smoker_no = c("no"),
label_is_current_smoker_yes = c("yes"),
label_is_current_smoker_unknown = c(NA, NaN),
error_call = rlang::caller_env()
)
Arguments
have_typical_chest_pain |
The value of variable in the parameters
|
have_diabetes |
The value of variable in the parameters
|
have_hypertension |
The value of variable in the parameters
|
have_family_history |
The value of variable in the parameters
|
is_current_smoker |
The value of variable in the parameters
|
max_na |
Input integer 0 to 5 to indicate the maximum number of
missing risk factors to tolerate before outputting an |
label_have_typical_chest_pain_no |
Label(s) for patient not having
typical chest pain symptom.
Default: |
label_have_typical_chest_pain_yes |
Label(s) for patient having
typical chest pain symptom.
Default: |
label_have_typical_chest_pain_unknown |
Label(s) for patient having unknown typical chest pain symptom. |
label_have_diabetes_no |
Label(s) for patient with no diabetes.
Default: |
label_have_diabetes_yes |
Label(s) for patient having diabetes.
Default: |
label_have_diabetes_unknown |
Label(s) for patient
having unknown diabetes.
Default: |
label_have_hypertension_no |
Label(s) for patient with no hypertension.
Default: |
label_have_hypertension_yes |
Label(s) for patient having hypertension.
Default: |
label_have_hypertension_unknown |
Label(s) for patient
having unknown hypertension.
Default: |
label_have_family_history_no |
Label(s) for patient with no family history of CAD.
Default: |
label_have_family_history_yes |
Label(s) for patient having family history of CAD.
Default: |
label_have_family_history_unknown |
Label(s) for patient
having unknown family history of CAD.
Default: |
label_is_current_smoker_no |
Label(s) for patients who are not current smokers.
Default: |
label_is_current_smoker_yes |
Label(s) for patients who are current smokers.
Default: |
label_is_current_smoker_unknown |
Label(s) for patient with unknown smoking status. |
error_call |
The execution environment of a currently
running function, e.g. |
Value
An integer indicating the number of risk factors the patient has.
It can also be NA
if the number of missing risk factors exceeds the max_na
input value
Examples
calculate_confirm_2015_num_of_rf(
have_typical_chest_pain = "yes",
have_diabetes = "yes",
have_hypertension = "yes",
have_family_history = "yes",
is_current_smoker = "no"
)
calculate_confirm_2015_num_of_rf(
have_typical_chest_pain = "no",
have_diabetes = "no",
have_hypertension = "no",
have_family_history = NA,
is_current_smoker = "no",
max_na = 0
)
calculate_confirm_2015_num_of_rf(
have_typical_chest_pain = "no",
have_diabetes = "no",
have_hypertension = "no",
have_family_history = NA,
is_current_smoker = "no",
max_na = 1
)
Calculate 2015 CONFIRM Risk Score for obstructive CAD
Description
This function returns a patient's risk score for obstructive coronary artery disease based on the 2015 CONFIRM Risk Score.
Usage
calculate_confirm_2015_ptp(
age,
sex,
have_typical_chest_pain,
have_diabetes,
have_hypertension,
have_family_history,
is_current_smoker,
max_na_num_of_rf = 0,
output = c("text", "percentage"),
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
label_have_typical_chest_pain_no = c("no"),
label_have_typical_chest_pain_yes = c("yes"),
label_have_typical_chest_pain_unknown = c(NA, NaN),
label_have_diabetes_no = c("no"),
label_have_diabetes_yes = c("yes"),
label_have_diabetes_unknown = c(NA, NaN),
label_have_hypertension_no = c("no"),
label_have_hypertension_yes = c("yes"),
label_have_hypertension_unknown = c(NA, NaN),
label_have_family_history_no = c("no"),
label_have_family_history_yes = c("yes"),
label_have_family_history_unknown = c(NA, NaN),
label_is_current_smoker_no = c("no"),
label_is_current_smoker_yes = c("yes"),
label_is_current_smoker_unknown = c(NA, NaN)
)
Arguments
age |
Input integer value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
have_typical_chest_pain |
The value of variable in the parameters
|
have_diabetes |
The value of variable in the parameters
|
have_hypertension |
The value of variable in the parameters
|
have_family_history |
The value of variable in the parameters
|
is_current_smoker |
The value of variable in the parameters
|
max_na_num_of_rf |
Input integer 0 to 5 to indicate the maximum number of
missing risk factors to tolerate before outputting an |
output |
Input text to indicate the how pre-test probability results be expressed Default: c("text", "percentage")
|
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
label_have_typical_chest_pain_no |
Label(s) for patient not having
typical chest pain symptom.
Default: |
label_have_typical_chest_pain_yes |
Label(s) for patient having
typical chest pain symptom.
Default: |
label_have_typical_chest_pain_unknown |
Label(s) for patient having unknown typical chest pain symptom. |
label_have_diabetes_no |
Label(s) for patient with no diabetes.
Default: |
label_have_diabetes_yes |
Label(s) for patient having diabetes.
Default: |
label_have_diabetes_unknown |
Label(s) for patient
having unknown diabetes.
Default: |
label_have_hypertension_no |
Label(s) for patient with no hypertension.
Default: |
label_have_hypertension_yes |
Label(s) for patient having hypertension.
Default: |
label_have_hypertension_unknown |
Label(s) for patient
having unknown hypertension.
Default: |
label_have_family_history_no |
Label(s) for patient with no family history of CAD.
Default: |
label_have_family_history_yes |
Label(s) for patient having family history of CAD.
Default: |
label_have_family_history_unknown |
Label(s) for patient
having unknown family history of CAD.
Default: |
label_is_current_smoker_no |
Label(s) for patients who are not current smokers.
Default: |
label_is_current_smoker_yes |
Label(s) for patients who are current smokers.
Default: |
label_is_current_smoker_unknown |
Label(s) for patient with unknown smoking status. |
Details
The predictive model is based on CCTA images from 9093 patients from Phase I of the Coronary CT Angiography EvaluatioN For Clinical Outcomes: An InteRnational Multicenter (CONFIRM) registry.
Value
A numeric value representing the patient's risk score for obstructive CAD based on the 2015 CONFIRM Risk Score.
Examples
# 30 years old male current smoker with typical chest pain
calculate_confirm_2015_ptp(
age = 30,
sex = "male",
have_typical_chest_pain = "yes",
have_diabetes = "no",
have_hypertension = "no",
have_family_history = "no",
is_current_smoker = "yes",
max_na_num_of_rf = 0,
output = "percentage"
)
Calculate 1993 Duke Clinical Score for Left Main Disease
Description
This function returns a patient's pre-test probability (PTP) of severe (>75% luminal diameter narrowing of the left main coronary artery) coronary artery disease based on the 1993 Duke Clinical Score.
Usage
calculate_dcs_1993_lm_cad_ptp(
age,
sex,
have_typical_chest_pain,
have_peripheral_vascular_disease,
have_cerebrovascular_disease,
have_carotid_bruits,
duration_of_cad_symptoms_year,
max_na_vascular_disease_index = 0,
max_age = 65,
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
label_have_typical_chest_pain_no = c("no"),
label_have_typical_chest_pain_yes = c("yes"),
label_have_typical_chest_pain_unknown = c(NA, NaN),
label_have_pvd_no = c("no"),
label_have_pvd_yes = c("yes"),
label_have_pvd_unknown = c(NA, NaN),
label_have_cvd_no = c("no"),
label_have_cvd_yes = c("yes"),
label_have_cvd_unknown = c(NA, NaN),
label_have_carotid_bruits_no = c("no"),
label_have_carotid_bruits_yes = c("yes"),
label_have_carotid_bruits_unknown = c(NA, NaN)
)
Arguments
age |
Input numeric value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
have_typical_chest_pain |
The value of variable in the parameters
|
have_peripheral_vascular_disease |
The value of variable in the parameters
|
have_cerebrovascular_disease |
The value of variable in the parameters
|
have_carotid_bruits |
The value of variable in the parameters
|
duration_of_cad_symptoms_year |
Input integer to indicate the duration of coronary artery disease symptoms in years. |
max_na_vascular_disease_index |
Input integer 0 to 3 to indicate the maximum number of
missing disease history to tolerate before outputting an |
max_age |
Input positive integer to
indicate the maximum age to tolerate before outputting an |
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
label_have_typical_chest_pain_no |
Label(s) for patient not having
typical chest pain symptom.
Default: |
label_have_typical_chest_pain_yes |
Label(s) for patient having
typical chest pain symptom.
Default: |
label_have_typical_chest_pain_unknown |
Label(s) for patient having unknown typical chest pain symptom. |
label_have_pvd_no |
Label(s) for patient not having peripheral vascular disease.
Default: |
label_have_pvd_yes |
Label(s) for patient having peripheral vascular disease.
Default: |
label_have_pvd_unknown |
Label(s) for patient
having unknown peripheral vascular disease.
Default: |
label_have_cvd_no |
Label(s) for patient not having cerebrovascular disease.
Default: |
label_have_cvd_yes |
Label(s) for patient having cerebrovascular disease.
Default: |
label_have_cvd_unknown |
Label(s) for patient
having unknown cerebrovascular disease.
Default: |
label_have_carotid_bruits_no |
Label(s) for patient not having carotid bruits.
Default: |
label_have_carotid_bruits_yes |
Label(s) for patient having carotid bruits.
Default: |
label_have_carotid_bruits_unknown |
Label(s) for patient
having unknown carotid bruits.
Default: |
Details
The predictive model is based on patients referred for cardiac catheterisation between 1969 and 1983.
Value
A numeric value representing the patient's PTP for left main disease (>75% luminal diameter narrowing of the left main coronary artery) based on the 1993 Duke Clinical Score.
Examples
# 40 year old female with typical chest pain for one year,
# She has peripheral vascular and cerebrovascular disease.
calculate_dcs_1993_lm_cad_ptp(
age = 40,
sex = "female",
have_typical_chest_pain = "yes",
have_peripheral_vascular_disease = "yes",
have_cerebrovascular_disease = "yes",
have_carotid_bruits = "no",
duration_of_cad_symptoms_year = 1,
)
Calculate The Pain Index For Duke Clinical Score 1993
Description
A function used to calculate the patient's pain index. This is used to calculate the likelihood of severe coronary artery disease in the Duke Clinical Score 1993 paper.
Usage
calculate_dcs_1993_pain_index(
have_typical_chest_pain,
frequency_of_angina_pain_per_week,
have_progressive_angina,
have_nocturnal_angina,
have_q_waves,
have_st_t_changes,
max_na = 0,
max_frequency_of_angina_pain_per_week = 35,
label_have_typical_chest_pain_no = c("no"),
label_have_typical_chest_pain_yes = c("yes"),
label_have_typical_chest_pain_unknown = c(NA, NaN),
label_have_progressive_angina_no = c("no"),
label_have_progressive_angina_yes = c("yes"),
label_have_progressive_angina_unknown = c(NA, NaN),
label_have_nocturnal_angina_no = c("no"),
label_have_nocturnal_angina_yes = c("yes"),
label_have_nocturnal_angina_unknown = c(NA, NaN),
label_have_q_waves_no = c("no"),
label_have_q_waves_yes = c("yes"),
label_have_q_waves_unknown = c(NA, NaN),
label_have_st_t_changes_no = c("no"),
label_have_st_t_changes_yes = c("yes"),
label_have_st_t_changes_unknown = c(NA, NaN),
error_call = rlang::caller_env()
)
Arguments
have_typical_chest_pain |
The value of variable in the parameters
|
frequency_of_angina_pain_per_week |
Input integer to indicate the patient's frequency of angina per week. |
have_progressive_angina |
The value of variable in the parameters
|
have_nocturnal_angina |
The value of variable in the parameters
|
have_q_waves |
The value of variable in the parameters
|
have_st_t_changes |
The value of variable in the parameters
|
max_na |
Input integer 0 to 6 to indicate the maximum number of
missing symptoms to tolerate before outputting an |
max_frequency_of_angina_pain_per_week |
Input non-negative integer to
indicate the maximum frequency angina per week to tolerate before outputting an |
label_have_typical_chest_pain_no |
Label(s) for patient not having
typical chest pain symptom.
Default: |
label_have_typical_chest_pain_yes |
Label(s) for patient having
typical chest pain symptom.
Default: |
label_have_typical_chest_pain_unknown |
Label(s) for patient having unknown typical chest pain symptom. |
label_have_progressive_angina_no |
Label(s) for patient not having progressive angina.
Default: |
label_have_progressive_angina_yes |
Label(s) for patient having progressive angina.
Default: |
label_have_progressive_angina_unknown |
Label(s) for patient
having unknown progressive angina.
Default: |
label_have_nocturnal_angina_no |
Label(s) for patient not having nocturnal angina.
Default: |
label_have_nocturnal_angina_yes |
Label(s) for patient having nocturnal angina.
Default: |
label_have_nocturnal_angina_unknown |
Label(s) for patient
having unknown nocturnal angina.
Default: |
label_have_q_waves_no |
Label(s) for patient not having Q waves on ECG.
Default: |
label_have_q_waves_yes |
Label(s) for patient having Q waves on ECG.
Default: |
label_have_q_waves_unknown |
Label(s) for patient with unknown Q waves on ECG.
Default: |
label_have_st_t_changes_no |
Label(s) for patient not having ST-T changes on ECG.
Default: |
label_have_st_t_changes_yes |
Label(s) for patient having ST-T changes on ECG.
Default: |
label_have_st_t_changes_unknown |
Label(s) for patient with unknown ST-T changes on ECG.
Default: |
error_call |
The execution environment of a currently
running function, e.g. |
Value
An integer indicating the patient's pain index.
It can also be NA
if the number of missing symptoms exceeds the max_na
input value or the frequency of angina per week exceed the
max_frequency_of_angina_pain_per_week
input value.
Examples
calculate_dcs_1993_pain_index(
have_typical_chest_pain = "yes",
frequency_of_angina_pain_per_week = 10,
have_progressive_angina = "yes",
have_nocturnal_angina = "no",
have_q_waves = "no",
have_st_t_changes = "no",
max_na = 0,
max_frequency_of_angina_pain_per_week = 35
)
calculate_dcs_1993_pain_index(
have_typical_chest_pain = "yes",
frequency_of_angina_pain_per_week = 10,
have_progressive_angina = "yes",
have_nocturnal_angina = NA,
have_q_waves = "no",
have_st_t_changes = "no",
max_na = 0,
max_frequency_of_angina_pain_per_week = 35
)
calculate_dcs_1993_pain_index(
have_typical_chest_pain = "yes",
frequency_of_angina_pain_per_week = 10,
have_progressive_angina = "yes",
have_nocturnal_angina = NA,
have_q_waves = "no",
have_st_t_changes = "no",
max_na = 1,
max_frequency_of_angina_pain_per_week = 35
)
calculate_dcs_1993_pain_index(
have_typical_chest_pain = "yes",
frequency_of_angina_pain_per_week = 40,
have_progressive_angina = "yes",
have_nocturnal_angina = "no",
have_q_waves = "no",
have_st_t_changes = "no",
max_na = 0,
max_frequency_of_angina_pain_per_week = 35
)
calculate_dcs_1993_pain_index(
have_typical_chest_pain = "yes",
frequency_of_angina_pain_per_week = 40,
have_progressive_angina = "yes",
have_nocturnal_angina = "no",
have_q_waves = "no",
have_st_t_changes = "no",
max_na = 0,
max_frequency_of_angina_pain_per_week = NA
)
Calculate The Risk Factor Index For Duke Clinical Score 1993
Description
A function used to calculate the patient's risk factor index. This is used to calculate the likelihood of severe coronary artery disease in the Duke Clinical Score 1993 paper.
Usage
calculate_dcs_1993_risk_factor_index(
have_hypertension,
have_dyslipidemia,
have_diabetes,
max_na = 0,
label_have_hypertension_no = c("no"),
label_have_hypertension_yes = c("yes"),
label_have_hypertension_unknown = c(NA, NaN),
label_have_dyslipidemia_no = c("no"),
label_have_dyslipidemia_yes = c("yes"),
label_have_dyslipidemia_unknown = c(NA, NaN),
label_have_diabetes_no = c("no"),
label_have_diabetes_yes = c("yes"),
label_have_diabetes_unknown = c(NA, NaN),
error_call = rlang::caller_env()
)
Arguments
have_hypertension |
The value of variable in the parameters
|
have_dyslipidemia |
The value of variable in the parameters
|
have_diabetes |
The value of variable in the parameters
|
max_na |
Input integer 0 to 3 to indicate the maximum number of
missing risk factors to tolerate before outputting an |
label_have_hypertension_no |
Label(s) for patient with no hypertension.
Default: |
label_have_hypertension_yes |
Label(s) for patient having hypertension.
Default: |
label_have_hypertension_unknown |
Label(s) for patient
having unknown hypertension.
Default: |
label_have_dyslipidemia_no |
Label(s) for patient with no dyslipidemia.
Default: |
label_have_dyslipidemia_yes |
Label(s) for patient having dyslipidemia.
Default: |
label_have_dyslipidemia_unknown |
Label(s) for patient
having unknown dyslipidemia.
Default: |
label_have_diabetes_no |
Label(s) for patient with no diabetes.
Default: |
label_have_diabetes_yes |
Label(s) for patient having diabetes.
Default: |
label_have_diabetes_unknown |
Label(s) for patient
having unknown diabetes.
Default: |
error_call |
The execution environment of a currently
running function, e.g. |
Value
An integer indicating the patient's risk factor index.
It can also be NA
if the number of missing risk factors exceeds the max_na
input value.
Examples
calculate_dcs_1993_risk_factor_index(
have_hypertension = "yes",
have_dyslipidemia = "yes",
have_diabetes = "no"
)
calculate_dcs_1993_risk_factor_index(
have_hypertension = NA,
have_dyslipidemia = "yes",
have_diabetes = "no",
max_na = 0
)
calculate_dcs_1993_risk_factor_index(
have_hypertension = NA,
have_dyslipidemia = "yes",
have_diabetes = "no",
max_na = 1
)
Calculate 1993 Duke Clinical Score for Severe CAD
Description
This function returns a patient's pre-test probability (PTP) of severe (>75% luminal diameter narrowing of all three major coronary arteries or of the left main coronary artery) coronary artery disease based on the 1993 Duke Clinical Score.
Usage
calculate_dcs_1993_severe_cad_ptp(
age,
sex,
chest_pain_type,
have_progressive_angina,
have_nocturnal_angina,
have_peripheral_vascular_disease,
have_cerebrovascular_disease,
have_carotid_bruits,
have_hypertension,
have_dyslipidemia,
have_diabetes,
have_q_waves,
have_st_t_changes,
frequency_of_angina_pain_per_week,
duration_of_cad_symptoms_year,
max_na_risk_factor_index = 0,
max_na_pain_index = 0,
max_na_vascular_disease_index = 0,
max_frequency_of_angina_pain_per_week = 35,
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
label_cpt_nonanginal = c("nonanginal"),
label_cpt_atypical = c("atypical"),
label_cpt_typical = c("typical"),
label_cpt_unknown = c(NA, NaN),
label_have_progressive_angina_no = c("no"),
label_have_progressive_angina_yes = c("yes"),
label_have_progressive_angina_unknown = c(NA, NaN),
label_have_nocturnal_angina_no = c("no"),
label_have_nocturnal_angina_yes = c("yes"),
label_have_nocturnal_angina_unknown = c(NA, NaN),
label_have_pvd_no = c("no"),
label_have_pvd_yes = c("yes"),
label_have_pvd_unknown = c(NA, NaN),
label_have_cvd_no = c("no"),
label_have_cvd_yes = c("yes"),
label_have_cvd_unknown = c(NA, NaN),
label_have_carotid_bruits_no = c("no"),
label_have_carotid_bruits_yes = c("yes"),
label_have_carotid_bruits_unknown = c(NA, NaN),
label_have_hypertension_no = c("no"),
label_have_hypertension_yes = c("yes"),
label_have_hypertension_unknown = c(NA, NaN),
label_have_dyslipidemia_no = c("no"),
label_have_dyslipidemia_yes = c("yes"),
label_have_dyslipidemia_unknown = c(NA, NaN),
label_have_diabetes_no = c("no"),
label_have_diabetes_yes = c("yes"),
label_have_diabetes_unknown = c(NA, NaN),
label_have_q_waves_no = c("no"),
label_have_q_waves_yes = c("yes"),
label_have_q_waves_unknown = c(NA, NaN),
label_have_st_t_changes_no = c("no"),
label_have_st_t_changes_yes = c("yes"),
label_have_st_t_changes_unknown = c(NA, NaN)
)
Arguments
age |
Input numeric value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
chest_pain_type |
The value of variable in the parameters,
|
have_progressive_angina |
The value of variable in the parameters
|
have_nocturnal_angina |
The value of variable in the parameters
|
have_peripheral_vascular_disease |
The value of variable in the parameters
|
have_cerebrovascular_disease |
The value of variable in the parameters
|
have_carotid_bruits |
The value of variable in the parameters
|
have_hypertension |
The value of variable in the parameters
|
have_dyslipidemia |
The value of variable in the parameters
|
have_diabetes |
The value of variable in the parameters
|
have_q_waves |
The value of variable in the parameters
|
have_st_t_changes |
The value of variable in the parameters
|
frequency_of_angina_pain_per_week |
Input integer to indicate the patient's frequency of angina per week. |
duration_of_cad_symptoms_year |
Input integer to indicate the duration of coronary artery disease symptoms in years. |
max_na_risk_factor_index |
Input integer 0 to 3 to indicate the maximum number of
missing risk factors to tolerate before outputting an |
max_na_pain_index |
Input integer 0 to 5 to indicate the maximum number of
missing symptoms to tolerate before outputting an |
max_na_vascular_disease_index |
Input integer 0 to 3 to indicate the maximum number of
missing disease history to tolerate before outputting an |
max_frequency_of_angina_pain_per_week |
Input non-negative integer to
indicate the maximum frequency angina per week to tolerate before outputting an |
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
label_cpt_nonanginal |
Label(s) for patient having nonanginal or non-specific chest pain.
Default: |
label_cpt_atypical |
Label(s) for patient having atypical chest pain.
Default: |
label_cpt_typical |
Label(s) for patient having typical chest pain.
Default: |
label_cpt_unknown |
Label(s) for patient having unknown chest pain type symptoms.
Default: |
label_have_progressive_angina_no |
Label(s) for patient not having progressive angina.
Default: |
label_have_progressive_angina_yes |
Label(s) for patient having progressive angina.
Default: |
label_have_progressive_angina_unknown |
Label(s) for patient
having unknown progressive angina.
Default: |
label_have_nocturnal_angina_no |
Label(s) for patient not having nocturnal angina.
Default: |
label_have_nocturnal_angina_yes |
Label(s) for patient having nocturnal angina.
Default: |
label_have_nocturnal_angina_unknown |
Label(s) for patient
having unknown nocturnal angina.
Default: |
label_have_pvd_no |
Label(s) for patient not having peripheral vascular disease.
Default: |
label_have_pvd_yes |
Label(s) for patient having peripheral vascular disease.
Default: |
label_have_pvd_unknown |
Label(s) for patient
having unknown peripheral vascular disease.
Default: |
label_have_cvd_no |
Label(s) for patient not having cerebrovascular disease.
Default: |
label_have_cvd_yes |
Label(s) for patient having cerebrovascular disease.
Default: |
label_have_cvd_unknown |
Label(s) for patient
having unknown cerebrovascular disease.
Default: |
label_have_carotid_bruits_no |
Label(s) for patient not having carotid bruits.
Default: |
label_have_carotid_bruits_yes |
Label(s) for patient having carotid bruits.
Default: |
label_have_carotid_bruits_unknown |
Label(s) for patient
having unknown carotid bruits.
Default: |
label_have_hypertension_no |
Label(s) for patient with no hypertension.
Default: |
label_have_hypertension_yes |
Label(s) for patient having hypertension.
Default: |
label_have_hypertension_unknown |
Label(s) for patient
having unknown hypertension.
Default: |
label_have_dyslipidemia_no |
Label(s) for patient with no dyslipidemia.
Default: |
label_have_dyslipidemia_yes |
Label(s) for patient having dyslipidemia.
Default: |
label_have_dyslipidemia_unknown |
Label(s) for patient
having unknown dyslipidemia.
Default: |
label_have_diabetes_no |
Label(s) for patient with no diabetes.
Default: |
label_have_diabetes_yes |
Label(s) for patient having diabetes.
Default: |
label_have_diabetes_unknown |
Label(s) for patient
having unknown diabetes.
Default: |
label_have_q_waves_no |
Label(s) for patient not having Q waves on ECG.
Default: |
label_have_q_waves_yes |
Label(s) for patient having Q waves on ECG.
Default: |
label_have_q_waves_unknown |
Label(s) for patient with unknown Q waves on ECG.
Default: |
label_have_st_t_changes_no |
Label(s) for patient not having ST-T changes on ECG.
Default: |
label_have_st_t_changes_yes |
Label(s) for patient having ST-T changes on ECG.
Default: |
label_have_st_t_changes_unknown |
Label(s) for patient with unknown ST-T changes on ECG.
Default: |
Details
The predictive model is based on patients referred for cardiac catheterisation between 1969 and 1983.
Value
A numeric value representing the patient's PTP for severe (>75% luminal diameter narrowing of all three major coronary arteries or of the left main coronary artery) CAD based on the 1993 Duke Clinical Score.
Examples
# 40 year old female with typical chest pain for one year,
# She has progressive angina but no nocturnal angina.
# Angina pain lasted at most five times a week.
# She has peripheral vascular and cerebrovascular disease.
# She has hypertension but has no dyslipidemia and not diabetic.
# She has Q waves and ST-T changes on ECG.
calculate_dcs_1993_severe_cad_ptp(
age = 40,
sex = "female",
chest_pain_type = "typical",
have_progressive_angina = "yes",
have_nocturnal_angina = "no",
have_peripheral_vascular_disease = "yes",
have_cerebrovascular_disease = "yes",
have_carotid_bruits = "no",
have_hypertension = "yes",
have_dyslipidemia = "no",
have_diabetes = "no",
have_q_waves = "yes",
have_st_t_changes = "yes",
frequency_of_angina_pain_per_week = 5,
duration_of_cad_symptoms_year = 1,
)
Calculate 1993 Duke Clinical Score for Significant CAD
Description
This function returns a patient's pre-test probability (PTP) of significant (>75% luminal diameter narrowing of at least one major coronary artery) coronary artery disease based on the 1993 Duke Clinical Score.
Usage
calculate_dcs_1993_sig_cad_ptp(
age,
sex,
chest_pain_type,
have_mi,
have_smoking_history,
have_dyslipidemia,
have_diabetes,
have_q_waves,
have_st_t_changes,
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
label_cpt_nonanginal = c("nonanginal"),
label_cpt_atypical = c("atypical"),
label_cpt_typical = c("typical"),
label_cpt_unknown = c(NA, NaN),
label_have_mi_no = c("no"),
label_have_mi_yes = c("yes"),
label_have_mi_unknown = c(NA, NaN),
label_have_smoking_history_no = c("no"),
label_have_smoking_history_yes = c("yes"),
label_have_smoking_history_unknown = c(NA, NaN),
label_have_dyslipidemia_no = c("no"),
label_have_dyslipidemia_yes = c("yes"),
label_have_dyslipidemia_unknown = c(NA, NaN),
label_have_diabetes_no = c("no"),
label_have_diabetes_yes = c("yes"),
label_have_diabetes_unknown = c(NA, NaN),
label_have_q_waves_no = c("no"),
label_have_q_waves_yes = c("yes"),
label_have_q_waves_unknown = c(NA, NaN),
label_have_st_t_changes_no = c("no"),
label_have_st_t_changes_yes = c("yes"),
label_have_st_t_changes_unknown = c(NA, NaN)
)
Arguments
age |
Input numeric value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
chest_pain_type |
The value of variable in the parameters,
|
have_mi |
The value of variable in the parameters
|
have_smoking_history |
The value of variable in the parameters
|
have_dyslipidemia |
The value of variable in the parameters
|
have_diabetes |
The value of variable in the parameters
|
have_q_waves |
The value of variable in the parameters
|
have_st_t_changes |
The value of variable in the parameters
|
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
label_cpt_nonanginal |
Label(s) for patient having nonanginal or non-specific chest pain.
Default: |
label_cpt_atypical |
Label(s) for patient having atypical chest pain.
Default: |
label_cpt_typical |
Label(s) for patient having typical chest pain.
Default: |
label_cpt_unknown |
Label(s) for patient having unknown chest pain type symptoms.
Default: |
label_have_mi_no |
Label(s) for patient not having a previous history of MI.
Default: |
label_have_mi_yes |
Label(s) for patient having a previous history of MI.
Default: |
label_have_mi_unknown |
Label(s) for patient with unknown previous history of MI.
Default: |
label_have_smoking_history_no |
Label(s) for patient with
no smoking history (current or past).
Default: |
label_have_smoking_history_yes |
Label(s) for patient having
smoking history (current or past).
Default: |
label_have_smoking_history_unknown |
Label(s) for patient
having unknown smoking history (current or past).
Default: |
label_have_dyslipidemia_no |
Label(s) for patient with no dyslipidemia.
Default: |
label_have_dyslipidemia_yes |
Label(s) for patient having dyslipidemia.
Default: |
label_have_dyslipidemia_unknown |
Label(s) for patient
having unknown dyslipidemia.
Default: |
label_have_diabetes_no |
Label(s) for patient with no diabetes.
Default: |
label_have_diabetes_yes |
Label(s) for patient having diabetes.
Default: |
label_have_diabetes_unknown |
Label(s) for patient
having unknown diabetes.
Default: |
label_have_q_waves_no |
Label(s) for patient not having Q waves on ECG.
Default: |
label_have_q_waves_yes |
Label(s) for patient having Q waves on ECG.
Default: |
label_have_q_waves_unknown |
Label(s) for patient with unknown Q waves on ECG.
Default: |
label_have_st_t_changes_no |
Label(s) for patient not having ST-T changes on ECG.
Default: |
label_have_st_t_changes_yes |
Label(s) for patient having ST-T changes on ECG.
Default: |
label_have_st_t_changes_unknown |
Label(s) for patient with unknown ST-T changes on ECG.
Default: |
Details
The predictive model is based on patients referred for cardiac catheterisation between 1969 and 1983.
Value
A numeric value representing the patient's PTP for significant (>75% luminal diameter narrowing of at least one major coronary artery) CAD based on the 1993 Duke Clinical Score.
Examples
# 40 year old female with typical chest pain,
# previous history of MI,
# has diabetes but no dyslipidemia and a non-smoker.
# She has Q waves but no ST-T changes on ECG.
calculate_dcs_1993_sig_cad_ptp(
age = 40,
sex = "female",
chest_pain_type = "typical",
have_mi = "yes",
have_smoking_history = "no",
have_dyslipidemia = "no",
have_diabetes = "yes",
have_q_waves = "yes",
have_st_t_changes = "no"
)
Calculate The Vascular Disease Index For Duke Clinical Score 1993
Description
A function used to calculate the patient's vascular disease index. This is used to calculate the likelihood of severe coronary artery disease in the Duke Clinical Score 1993 paper.
Usage
calculate_dcs_1993_vascular_disease_index(
have_peripheral_vascular_disease,
have_cerebrovascular_disease,
have_carotid_bruits,
max_na = 0,
label_have_pvd_no = c("no"),
label_have_pvd_yes = c("yes"),
label_have_pvd_unknown = c(NA, NaN),
label_have_cvd_no = c("no"),
label_have_cvd_yes = c("yes"),
label_have_cvd_unknown = c(NA, NaN),
label_have_carotid_bruits_no = c("no"),
label_have_carotid_bruits_yes = c("yes"),
label_have_carotid_bruits_unknown = c(NA, NaN),
error_call = rlang::caller_env()
)
Arguments
have_peripheral_vascular_disease |
The value of variable in the parameters
|
have_cerebrovascular_disease |
The value of variable in the parameters
|
have_carotid_bruits |
The value of variable in the parameters
|
max_na |
Input integer 0 to 3 to indicate the maximum number of
missing disease history to tolerate before outputting an |
label_have_pvd_no |
Label(s) for patient not having peripheral vascular disease.
Default: |
label_have_pvd_yes |
Label(s) for patient having peripheral vascular disease.
Default: |
label_have_pvd_unknown |
Label(s) for patient
having unknown peripheral vascular disease.
Default: |
label_have_cvd_no |
Label(s) for patient not having cerebrovascular disease.
Default: |
label_have_cvd_yes |
Label(s) for patient having cerebrovascular disease.
Default: |
label_have_cvd_unknown |
Label(s) for patient
having unknown cerebrovascular disease.
Default: |
label_have_carotid_bruits_no |
Label(s) for patient not having carotid bruits.
Default: |
label_have_carotid_bruits_yes |
Label(s) for patient having carotid bruits.
Default: |
label_have_carotid_bruits_unknown |
Label(s) for patient
having unknown carotid bruits.
Default: |
error_call |
The execution environment of a currently
running function, e.g. |
Value
An integer indicating the patient's vascular disease index.
It can also be NA
if the number of missing disease history exceeds the max_na
input value.
Examples
calculate_dcs_1993_vascular_disease_index(
have_peripheral_vascular_disease = "yes",
have_cerebrovascular_disease = "yes",
have_carotid_bruits = "no"
)
calculate_dcs_1993_vascular_disease_index(
have_peripheral_vascular_disease = NA,
have_cerebrovascular_disease = "yes",
have_carotid_bruits = "no",
max_na = 0
)
calculate_dcs_1993_vascular_disease_index(
have_peripheral_vascular_disease = NA,
have_cerebrovascular_disease = "yes",
have_carotid_bruits = "no",
max_na = 1
)
Calculate Diamond-Forrester 1979 PTP for obstructive CAD
Description
This function returns a patient's pre-test Probability (PTP) of obstructive coronary artery disease (CAD) based on Diamond-Forrester 1979 model.
Usage
calculate_diamond_forrester_1979_ptp(
age,
sex,
chest_pain_type,
output = c("numeric", "percentage"),
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
label_cpt_nonanginal = c("nonanginal"),
label_cpt_atypical = c("atypical"),
label_cpt_typical = c("typical"),
label_cpt_unknown = c(NA, NaN)
)
Arguments
age |
Input integer value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
chest_pain_type |
The value of variable in the parameters,
|
output |
Input text to indicate the how pre-test probability results be expressed Default: c("numeric", "percentage")
|
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
label_cpt_nonanginal |
Label(s) for patient having nonanginal or non-specific chest pain.
Default: |
label_cpt_atypical |
Label(s) for patient having atypical chest pain.
Default: |
label_cpt_typical |
Label(s) for patient having typical chest pain.
Default: |
label_cpt_unknown |
Label(s) for patient having unknown chest pain type symptoms.
Default: |
Value
A numeric or percentage representing the patient's PTP for obstructive CAD based on Diamond-Forrester 1979 model.
Examples
# 35 year old female with typical chest pain
calculate_diamond_forrester_1979_ptp(
age = 35,
sex = "female",
chest_pain_type = "typical",
output = "percentage"
)
# 65 year old male with nonanginal chest pain
calculate_diamond_forrester_1979_ptp(
age = 65,
sex = "male",
chest_pain_type = "nonanginal",
output = "percentage"
)
Calculate ESC 2013 PTP for obstructive CAD
Description
This function returns a patient's pre-test Probability (PTP) of obstructive coronary artery disease (CAD) based on the European Society of Cardiology (ESC) 2013 guidelines.
Usage
calculate_esc_2013_ptp(
age,
sex,
chest_pain_type,
output = c("numeric", "percentage")
)
Arguments
age |
Input integer value to indicate the age of the patient. |
sex |
Input characters (female, male) to indicate the sex of the patient.
|
chest_pain_type |
Input characters (typical, atypical, nonanginal) to indicate the chest pain characteristics of the patient.
|
output |
Input text to indicate the how pre-test probability results be expressed Default: c("numeric", "percentage")
|
Details
The predictive model used to create the guidelines are based on the journal A clinical prediction rule for the diagnosis of coronary artery disease: validation, updating, and extension by 2011 Genders et. al.
Value
An integer or percentage representing the patient's PTP for obstructive CAD based on the ESC 2013 guidelines.
Examples
# 35 year old female with typical chest pain
calculate_esc_2013_ptp(
age = 35,
sex = "female",
chest_pain_type = "typical",
output = "percentage"
)
# 65 year old male with nonanginal chest pain
calculate_esc_2013_ptp(
age = 65,
sex = "male",
chest_pain_type = "nonanginal",
output = "percentage"
)
Calculate ESC 2019 PTP for obstructive CAD
Description
This function returns a patient's pre-test Probability (PTP) of obstructive coronary artery disease (CAD) based on the European Society of Cardiology (ESC) 2019 guidelines.
Usage
calculate_esc_2019_ptp(
age,
sex,
have_dyspnoea,
chest_pain_type,
output = c("grouping", "numeric", "percentage"),
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
label_have_dyspnoea_no = c("no"),
label_have_dyspnoea_yes = c("yes"),
label_have_dyspnoea_unknown = c(NA, NaN),
label_cpt_no_chest_pain = c("no chest pain"),
label_cpt_nonanginal = c("nonanginal"),
label_cpt_atypical = c("atypical"),
label_cpt_typical = c("typical"),
label_cpt_unknown = c(NA, NaN)
)
Arguments
age |
Input integer value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
have_dyspnoea |
The value of variable in the parameters |
chest_pain_type |
The value of variable in the parameters |
output |
Input text to indicate the how pre-test probability results be expressed Default: c("grouping", "numeric", "percentage")
|
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
label_have_dyspnoea_no |
Label(s) for patient having no dyspnoea symptoms.
Default: |
label_have_dyspnoea_yes |
Label(s) for patient having dyspnoea symptoms.
Default: |
label_have_dyspnoea_unknown |
Label(s) for patient having unknown dyspnoea symptoms.
Default: |
label_cpt_no_chest_pain |
Label(s) for patient having no chest pain.
Default: |
label_cpt_nonanginal |
Label(s) for patient having nonanginal or non-specific chest pain.
Default: |
label_cpt_atypical |
Label(s) for patient having atypical chest pain.
Default: |
label_cpt_typical |
Label(s) for patient having typical chest pain.
Default: |
label_cpt_unknown |
Label(s) for patient having unknown chest pain type symptoms.
Default: |
Details
The predictive model used to create the guidelines are based on patients from European countries with low cardiovascular disease (CVD) risk.
If the patient has both dyspnoea and a particular chest pain type (typical, atypical, nonanginal), The chest pain type will take precedence over dyspnoea.
Value
An integer, percentage or category representing the patient's PTP for obstructive CAD
based on the ESC 2019 guidelines.
See parameter option output
for more information.
Examples
# 35 year old female with typical chest pain
calculate_esc_2019_ptp(
age = 35,
sex = "female",
have_dyspnoea = "no",
chest_pain_type = "typical",
output = "percentage"
)
# 75 year old male with only dyspnoea
calculate_esc_2019_ptp(
age = 75,
sex = "male",
have_dyspnoea = "yes",
chest_pain_type = "no chest pain",
output = "percentage"
)
Calculate ESC 2024 PTP for obstructive CAD
Description
This function returns a patient's pre-test Probability (PTP) of obstructive coronary artery disease (CAD) based on the European Society of Cardiology (ESC) 2024 guidelines.
Usage
calculate_esc_2024_fig_4_ptp(
age,
sex,
chest_pain_type,
have_dyspnoea,
have_family_history,
have_smoking_history,
have_dyslipidemia,
have_hypertension,
have_diabetes,
allow_na_symptom_score = TRUE,
max_na_num_of_rf = 0,
output = c("grouping", "numeric", "percentage"),
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
label_have_dyspnoea_no = c("no"),
label_have_dyspnoea_yes = c("yes"),
label_have_dyspnoea_unknown = c(NA, NaN),
label_cpt_no_chest_pain = c("no chest pain"),
label_cpt_nonanginal = c("nonanginal"),
label_cpt_atypical = c("atypical"),
label_cpt_typical = c("typical"),
label_cpt_unknown = c(NA, NaN),
label_have_family_history_no = c("no"),
label_have_family_history_yes = c("yes"),
label_have_family_history_unknown = c(NA, NaN),
label_have_smoking_history_no = c("no"),
label_have_smoking_history_yes = c("yes"),
label_have_smoking_history_unknown = c(NA, NaN),
label_have_dyslipidemia_no = c("no"),
label_have_dyslipidemia_yes = c("yes"),
label_have_dyslipidemia_unknown = c(NA, NaN),
label_have_hypertension_no = c("no"),
label_have_hypertension_yes = c("yes"),
label_have_hypertension_unknown = c(NA, NaN),
label_have_diabetes_no = c("no"),
label_have_diabetes_yes = c("yes"),
label_have_diabetes_unknown = c(NA, NaN)
)
Arguments
age |
Input integer value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
chest_pain_type |
The value of variable in the parameters |
have_dyspnoea |
The value of variable in the parameters |
have_family_history |
The value of variable in the parameters
|
have_smoking_history |
The value of variable in the parameters
|
have_dyslipidemia |
The value of variable in the parameters
|
have_hypertension |
The value of variable in the parameters
|
have_diabetes |
The value of variable in the parameters
|
allow_na_symptom_score |
A logical evaluating to |
max_na_num_of_rf |
Input integer 0 to 5 to indicate the maximum number of
missing risk factors to tolerate before outputting an |
output |
Input text to indicate the how pre-test probability results be expressed Default: c("grouping", "numeric", "percentage")
|
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
label_have_dyspnoea_no |
Label(s) for patient having no dyspnoea symptoms.
Default: |
label_have_dyspnoea_yes |
Label(s) for patient having dyspnoea symptoms.
Default: |
label_have_dyspnoea_unknown |
Label(s) for patient having unknown dyspnoea symptoms.
Default: |
label_cpt_no_chest_pain |
Label(s) for patient having no chest pain.
Default: |
label_cpt_nonanginal |
Label(s) for patient having nonanginal or non-specific chest pain.
Default: |
label_cpt_atypical |
Label(s) for patient having atypical chest pain.
Default: |
label_cpt_typical |
Label(s) for patient having typical chest pain.
Default: |
label_cpt_unknown |
Label(s) for patient having unknown chest pain type symptoms.
Default: |
label_have_family_history_no |
Label(s) for patient with no family history of CAD.
Default: |
label_have_family_history_yes |
Label(s) for patient having family history of CAD.
Default: |
label_have_family_history_unknown |
Label(s) for patient
having unknown family history of CAD.
Default: |
label_have_smoking_history_no |
Label(s) for patient with
no smoking history (current or past).
Default: |
label_have_smoking_history_yes |
Label(s) for patient having
smoking history (current or past).
Default: |
label_have_smoking_history_unknown |
Label(s) for patient
having unknown smoking history (current or past).
Default: |
label_have_dyslipidemia_no |
Label(s) for patient with no dyslipidemia.
Default: |
label_have_dyslipidemia_yes |
Label(s) for patient having dyslipidemia.
Default: |
label_have_dyslipidemia_unknown |
Label(s) for patient
having unknown dyslipidemia.
Default: |
label_have_hypertension_no |
Label(s) for patient with no hypertension.
Default: |
label_have_hypertension_yes |
Label(s) for patient having hypertension.
Default: |
label_have_hypertension_unknown |
Label(s) for patient
having unknown hypertension.
Default: |
label_have_diabetes_no |
Label(s) for patient with no diabetes.
Default: |
label_have_diabetes_yes |
Label(s) for patient having diabetes.
Default: |
label_have_diabetes_unknown |
Label(s) for patient
having unknown diabetes.
Default: |
Value
An integer, percentage or category representing the patient's PTP for obstructive CAD
based on the ESC 2024 guidelines.
See parameter option output
for more information.
Examples
# 30 female with symptom score of 0 and 0 risk factors
calculate_esc_2024_fig_4_ptp(
age = 30,
sex = "female",
chest_pain_type = "no chest pain",
have_dyspnoea = "no",
have_family_history = "no",
have_smoking_history = "no",
have_dyslipidemia = "no",
have_hypertension = "no",
have_diabetes = "no",
allow_na_symptom_score = TRUE,
max_na_num_of_rf = 0,
output = "percentage"
)
Calculate ESC 2024 PTP for obstructive CAD
Description
This function returns a patient's pre-test Probability (PTP) of obstructive coronary artery disease (CAD) based on the European Society of Cardiology (ESC) 2024 guidelines.
Usage
calculate_esc_2024_fig_4_ptp_simplfied(
age,
sex,
symptom_score,
num_of_rf,
output = c("grouping", "numeric", "percentage"),
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
error_call = rlang::caller_env()
)
Arguments
age |
Input integer value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
symptom_score |
An integer indicating the symptom score of the patient.
This value can be calculated via the |
num_of_rf |
An integer indicating the number of risk factors the patient has.
This value can be calculated via the
|
output |
Input text to indicate the how pre-test probability results be expressed Default: c("grouping", "numeric", "percentage")
|
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
error_call |
The execution environment of a currently
running function, e.g. |
Value
An integer, percentage or category representing the patient's PTP for obstructive CAD
based on the ESC 2024 guidelines.
See parameter option output
for more information.
Examples
# 30 female with symptom score of 0 and 0 risk factors
calculate_esc_2024_fig_4_ptp_simplfied(
age = 30,
sex = "female",
symptom_score = 0,
num_of_rf = 0,
output = "percentage"
)
Calculate Number Of Risk Factors (ESC 2024)
Description
A function used to calculate the number of risk factors the patient has. This is used to calculate the pretest probability of coronary artery disease (CAD) based on the ESC 2024 guidelines.
Usage
calculate_esc_2024_num_of_rf(
have_family_history,
have_smoking_history,
have_dyslipidemia,
have_hypertension,
have_diabetes,
max_na = 0,
label_have_family_history_no = c("no"),
label_have_family_history_yes = c("yes"),
label_have_family_history_unknown = c(NA, NaN),
label_have_smoking_history_no = c("no"),
label_have_smoking_history_yes = c("yes"),
label_have_smoking_history_unknown = c(NA, NaN),
label_have_dyslipidemia_no = c("no"),
label_have_dyslipidemia_yes = c("yes"),
label_have_dyslipidemia_unknown = c(NA, NaN),
label_have_hypertension_no = c("no"),
label_have_hypertension_yes = c("yes"),
label_have_hypertension_unknown = c(NA, NaN),
label_have_diabetes_no = c("no"),
label_have_diabetes_yes = c("yes"),
label_have_diabetes_unknown = c(NA, NaN),
error_call = rlang::caller_env()
)
Arguments
have_family_history |
The value of variable in the parameters
|
have_smoking_history |
The value of variable in the parameters
|
have_dyslipidemia |
The value of variable in the parameters
|
have_hypertension |
The value of variable in the parameters
|
have_diabetes |
The value of variable in the parameters
|
max_na |
Input integer 0 to 5 to indicate the maximum number of
missing risk factors to tolerate before outputting an |
label_have_family_history_no |
Label(s) for patient with no family history of CAD.
Default: |
label_have_family_history_yes |
Label(s) for patient having family history of CAD.
Default: |
label_have_family_history_unknown |
Label(s) for patient
having unknown family history of CAD.
Default: |
label_have_smoking_history_no |
Label(s) for patient with
no smoking history (current or past).
Default: |
label_have_smoking_history_yes |
Label(s) for patient having
smoking history (current or past).
Default: |
label_have_smoking_history_unknown |
Label(s) for patient
having unknown smoking history (current or past).
Default: |
label_have_dyslipidemia_no |
Label(s) for patient with no dyslipidemia.
Default: |
label_have_dyslipidemia_yes |
Label(s) for patient having dyslipidemia.
Default: |
label_have_dyslipidemia_unknown |
Label(s) for patient
having unknown dyslipidemia.
Default: |
label_have_hypertension_no |
Label(s) for patient with no hypertension.
Default: |
label_have_hypertension_yes |
Label(s) for patient having hypertension.
Default: |
label_have_hypertension_unknown |
Label(s) for patient
having unknown hypertension.
Default: |
label_have_diabetes_no |
Label(s) for patient with no diabetes.
Default: |
label_have_diabetes_yes |
Label(s) for patient having diabetes.
Default: |
label_have_diabetes_unknown |
Label(s) for patient
having unknown diabetes.
Default: |
error_call |
The execution environment of a currently
running function, e.g. |
Value
An integer indicating the number of risk factors the patient has.
It can also be NA
if the number of missing risk factors exceeds the max_na
input value.
Examples
calculate_esc_2024_num_of_rf(
have_family_history = "yes",
have_smoking_history = "yes",
have_dyslipidemia = "yes",
have_hypertension = "yes",
have_diabetes = "no"
)
calculate_esc_2024_num_of_rf(
have_family_history = "no",
have_smoking_history = "no",
have_dyslipidemia = "no",
have_hypertension = NA,
have_diabetes = "no",
max_na = 0
)
calculate_esc_2024_num_of_rf(
have_family_history = "no",
have_smoking_history = "no",
have_dyslipidemia = "no",
have_hypertension = NA,
have_diabetes = "no",
max_na = 1
)
Calculate Symptom Score (ESC 2024)
Description
A function used to calculate the symptom score of the patient. This is used to calculate the pretest probability of coronary artery disease (CAD) based on the ESC 2024 guidelines.
Usage
calculate_esc_2024_symptom_score(
chest_pain_type,
have_dyspnoea,
allow_na = TRUE,
label_have_dyspnoea_no = c("no"),
label_have_dyspnoea_yes = c("yes"),
label_have_dyspnoea_unknown = c(NA, NaN),
label_cpt_no_chest_pain = c("no chest pain"),
label_cpt_nonanginal = c("nonanginal"),
label_cpt_atypical = c("atypical"),
label_cpt_typical = c("typical"),
label_cpt_unknown = c(NA, NaN),
error_call = rlang::caller_env()
)
Arguments
chest_pain_type |
The value of variable in the parameters |
have_dyspnoea |
The value of variable in the parameters |
allow_na |
A logical evaluating to |
label_have_dyspnoea_no |
Label(s) for patient having no dyspnoea symptoms.
Default: |
label_have_dyspnoea_yes |
Label(s) for patient having dyspnoea symptoms.
Default: |
label_have_dyspnoea_unknown |
Label(s) for patient having unknown dyspnoea symptoms.
Default: |
label_cpt_no_chest_pain |
Label(s) for patient having no chest pain.
Default: |
label_cpt_nonanginal |
Label(s) for patient having nonanginal or non-specific chest pain.
Default: |
label_cpt_atypical |
Label(s) for patient having atypical chest pain.
Default: |
label_cpt_typical |
Label(s) for patient having typical chest pain.
Default: |
label_cpt_unknown |
Label(s) for patient having unknown chest pain type symptoms.
Default: |
error_call |
The execution environment of a currently
running function, e.g. |
Value
An integer indicating the symptom score of the patient.
It can also be NA
if both chest_pain_type
and have_dyspnoea
are NA
.
Patients with both nonanginal chest pain and dyspnoea will be given a score of 2
Examples
calculate_esc_2024_symptom_score(
chest_pain_type = "nonanginal",
have_dyspnoea = "yes",
allow_na = TRUE
)
calculate_esc_2024_symptom_score(
chest_pain_type = "nonanginal",
have_dyspnoea = NA,
allow_na = FALSE
)
calculate_esc_2024_symptom_score(
chest_pain_type = "nonanginal",
have_dyspnoea = NA,
allow_na = TRUE
)
Calculate 2022 LAH Clinical PTP for obstructive CAD
Description
This function returns a patient's pre-test probability (PTP) of obstructive coronary artery disease based on the 2022 Local Assessment of the Heart (LAH) clinical model.
Usage
calculate_lah_2022_clinical_ptp(
age,
sex,
chest_pain_type,
have_diabetes,
have_hypertension,
have_dyslipidemia,
have_smoking_history,
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
label_cpt_nonanginal = c("nonanginal"),
label_cpt_atypical = c("atypical"),
label_cpt_typical = c("typical"),
label_cpt_unknown = c(NA, NaN),
label_have_diabetes_no = c("no"),
label_have_diabetes_yes = c("yes"),
label_have_diabetes_unknown = c(NA, NaN),
label_have_hypertension_no = c("no"),
label_have_hypertension_yes = c("yes"),
label_have_hypertension_unknown = c(NA, NaN),
label_have_dyslipidemia_no = c("no"),
label_have_dyslipidemia_yes = c("yes"),
label_have_dyslipidemia_unknown = c(NA, NaN),
label_have_smoking_history_no = c("no"),
label_have_smoking_history_yes = c("yes"),
label_have_smoking_history_unknown = c(NA, NaN)
)
Arguments
age |
Input numeric value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
chest_pain_type |
The value of variable in the parameters,
|
have_diabetes |
The value of variable in the parameters
|
have_hypertension |
The value of variable in the parameters
|
have_dyslipidemia |
The value of variable in the parameters
|
have_smoking_history |
The value of variable in the parameters
|
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
label_cpt_nonanginal |
Label(s) for patient having nonanginal or non-specific chest pain.
Default: |
label_cpt_atypical |
Label(s) for patient having atypical chest pain.
Default: |
label_cpt_typical |
Label(s) for patient having typical chest pain.
Default: |
label_cpt_unknown |
Label(s) for patient having unknown chest pain type symptoms.
Default: |
label_have_diabetes_no |
Label(s) for patient with no diabetes.
Default: |
label_have_diabetes_yes |
Label(s) for patient having diabetes.
Default: |
label_have_diabetes_unknown |
Label(s) for patient
having unknown diabetes.
Default: |
label_have_hypertension_no |
Label(s) for patient with no hypertension.
Default: |
label_have_hypertension_yes |
Label(s) for patient having hypertension.
Default: |
label_have_hypertension_unknown |
Label(s) for patient
having unknown hypertension.
Default: |
label_have_dyslipidemia_no |
Label(s) for patient with no dyslipidemia.
Default: |
label_have_dyslipidemia_yes |
Label(s) for patient having dyslipidemia.
Default: |
label_have_dyslipidemia_unknown |
Label(s) for patient
having unknown dyslipidemia.
Default: |
label_have_smoking_history_no |
Label(s) for patient with
no smoking history (current or past).
Default: |
label_have_smoking_history_yes |
Label(s) for patient having
smoking history (current or past).
Default: |
label_have_smoking_history_unknown |
Label(s) for patient
having unknown smoking history (current or past).
Default: |
Details
The predictive model is based on patients a mixed Asian cohort within Singapore with stable chest pain.
Value
A numeric value representing the patient's PTP for obstructive CAD based on the 2022 Local Assessment of the Heart (LAH) clinical model.
Examples
# 40 year old female with typical chest pain,
# diabetes but no hypertension, dyslipidemia
# and a non-smoker
calculate_lah_2022_clinical_ptp(
age = 40,
sex = "female",
chest_pain_type = "typical",
have_diabetes = "yes",
have_hypertension = "no",
have_dyslipidemia = "no",
have_smoking_history = "no"
)
Calculate 2022 LAH Extended PTP for obstructive CAD
Description
This function returns a patient's pre-test probability (PTP) of obstructive coronary artery disease based on the 2022 Local Assessment of the Heart (LAH) extended model.
Usage
calculate_lah_2022_extended_ptp(
age,
sex,
chest_pain_type,
have_diabetes,
have_hypertension,
have_dyslipidemia,
have_smoking_history,
coronary_calcium_score,
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
label_cpt_nonanginal = c("nonanginal"),
label_cpt_atypical = c("atypical"),
label_cpt_typical = c("typical"),
label_cpt_unknown = c(NA, NaN),
label_have_diabetes_no = c("no"),
label_have_diabetes_yes = c("yes"),
label_have_diabetes_unknown = c(NA, NaN),
label_have_hypertension_no = c("no"),
label_have_hypertension_yes = c("yes"),
label_have_hypertension_unknown = c(NA, NaN),
label_have_dyslipidemia_no = c("no"),
label_have_dyslipidemia_yes = c("yes"),
label_have_dyslipidemia_unknown = c(NA, NaN),
label_have_smoking_history_no = c("no"),
label_have_smoking_history_yes = c("yes"),
label_have_smoking_history_unknown = c(NA, NaN)
)
Arguments
age |
Input numeric value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
chest_pain_type |
The value of variable in the parameters,
|
have_diabetes |
The value of variable in the parameters
|
have_hypertension |
The value of variable in the parameters
|
have_dyslipidemia |
The value of variable in the parameters
|
have_smoking_history |
The value of variable in the parameters
|
coronary_calcium_score |
Input non-negative numeric to indicate the total coronary calcium score of the patient. |
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
label_cpt_nonanginal |
Label(s) for patient having nonanginal or non-specific chest pain.
Default: |
label_cpt_atypical |
Label(s) for patient having atypical chest pain.
Default: |
label_cpt_typical |
Label(s) for patient having typical chest pain.
Default: |
label_cpt_unknown |
Label(s) for patient having unknown chest pain type symptoms.
Default: |
label_have_diabetes_no |
Label(s) for patient with no diabetes.
Default: |
label_have_diabetes_yes |
Label(s) for patient having diabetes.
Default: |
label_have_diabetes_unknown |
Label(s) for patient
having unknown diabetes.
Default: |
label_have_hypertension_no |
Label(s) for patient with no hypertension.
Default: |
label_have_hypertension_yes |
Label(s) for patient having hypertension.
Default: |
label_have_hypertension_unknown |
Label(s) for patient
having unknown hypertension.
Default: |
label_have_dyslipidemia_no |
Label(s) for patient with no dyslipidemia.
Default: |
label_have_dyslipidemia_yes |
Label(s) for patient having dyslipidemia.
Default: |
label_have_dyslipidemia_unknown |
Label(s) for patient
having unknown dyslipidemia.
Default: |
label_have_smoking_history_no |
Label(s) for patient with
no smoking history (current or past).
Default: |
label_have_smoking_history_yes |
Label(s) for patient having
smoking history (current or past).
Default: |
label_have_smoking_history_unknown |
Label(s) for patient
having unknown smoking history (current or past).
Default: |
Details
The predictive model is based on patients a mixed Asian cohort within Singapore with stable chest pain.
Value
A numeric value representing the patient's PTP for obstructive CAD based on the 2022 Local Assessment of the Heart (LAH) extended model.
Examples
# 40 year old female with typical chest pain,
# diabetes but no hypertension, dyslipidemia,
# a non-smoker and a coronary calcium score of 0
calculate_lah_2022_extended_ptp(
age = 40,
sex = "female",
chest_pain_type = "typical",
have_diabetes = "yes",
have_hypertension = "no",
have_dyslipidemia = "no",
have_smoking_history = "no",
coronary_calcium_score = 0
)
Calculate 2021 PRECISE Clinical PTP for obstructive CAD
Description
This function returns a patient's pre-test probability (PTP) of obstructive coronary artery disease based on the 2021 Predictive Risk scorE for CAD In Southeast Asians with chEst pain (PRECISE) clinical model.
Usage
calculate_precise_2021_clinical_ptp(
age,
sex,
chest_pain_type,
have_neck_radiation,
have_diabetes,
have_hypertension,
smoking_history_type,
have_q_waves,
have_st_t_changes,
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
label_cpt_nonanginal = c("nonanginal"),
label_cpt_atypical = c("atypical"),
label_cpt_typical = c("typical"),
label_cpt_unknown = c(NA, NaN),
label_have_neck_radiation_no = c("no"),
label_have_neck_radiation_yes = c("yes"),
label_have_neck_radiation_unknown = c(NA, NaN),
label_have_diabetes_no = c("no"),
label_have_diabetes_yes = c("yes"),
label_have_diabetes_unknown = c(NA, NaN),
label_have_hypertension_no = c("no"),
label_have_hypertension_yes = c("yes"),
label_have_hypertension_unknown = c(NA, NaN),
label_smoking_history_type_current = c("current"),
label_smoking_history_type_past = c("past"),
label_smoking_history_type_none = c("none"),
label_smoking_history_type_unknown = c(NA, NaN),
label_have_q_waves_no = c("no"),
label_have_q_waves_yes = c("yes"),
label_have_q_waves_unknown = c(NA, NaN),
label_have_st_t_changes_no = c("no"),
label_have_st_t_changes_yes = c("yes"),
label_have_st_t_changes_unknown = c(NA, NaN)
)
Arguments
age |
Input numeric value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
chest_pain_type |
The value of variable in the parameters,
|
have_neck_radiation |
The value of variable in the parameters
|
have_diabetes |
The value of variable in the parameters
|
have_hypertension |
The value of variable in the parameters
|
smoking_history_type |
The value of variable in the parameters
|
have_q_waves |
The value of variable in the parameters
|
have_st_t_changes |
The value of variable in the parameters
|
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
label_cpt_nonanginal |
Label(s) for patient having nonanginal or non-specific chest pain.
Default: |
label_cpt_atypical |
Label(s) for patient having atypical chest pain.
Default: |
label_cpt_typical |
Label(s) for patient having typical chest pain.
Default: |
label_cpt_unknown |
Label(s) for patient having unknown chest pain type symptoms.
Default: |
label_have_neck_radiation_no |
Label(s) for patient without
chest pain radiating to the neck.
Default: |
label_have_neck_radiation_yes |
Label(s) for patient with
chest pain radiating to the neck.
Default: |
label_have_neck_radiation_unknown |
Label(s) for patient with unknown
chest pain radiating to the neck
Default: |
label_have_diabetes_no |
Label(s) for patient with no diabetes.
Default: |
label_have_diabetes_yes |
Label(s) for patient having diabetes.
Default: |
label_have_diabetes_unknown |
Label(s) for patient
having unknown diabetes.
Default: |
label_have_hypertension_no |
Label(s) for patient with no hypertension.
Default: |
label_have_hypertension_yes |
Label(s) for patient having hypertension.
Default: |
label_have_hypertension_unknown |
Label(s) for patient
having unknown hypertension.
Default: |
label_smoking_history_type_current |
Label(s) for patient who is a current smoker.
Default: |
label_smoking_history_type_past |
Label(s) for patient who is a past smoker.
Default: |
label_smoking_history_type_none |
Label(s) for patient who is a non-smoker.
Default: |
label_smoking_history_type_unknown |
Label(s) for patient with unknown smoking history.
Default: |
label_have_q_waves_no |
Label(s) for patient not having Q waves on ECG.
Default: |
label_have_q_waves_yes |
Label(s) for patient having Q waves on ECG.
Default: |
label_have_q_waves_unknown |
Label(s) for patient with unknown Q waves on ECG.
Default: |
label_have_st_t_changes_no |
Label(s) for patient not having ST-T changes on ECG.
Default: |
label_have_st_t_changes_yes |
Label(s) for patient having ST-T changes on ECG.
Default: |
label_have_st_t_changes_unknown |
Label(s) for patient with unknown ST-T changes on ECG.
Default: |
Details
The predictive model is based on patients a mixed Asian cohort within Singapore with stable chest pain.
Value
A numeric value representing the patient's PTP for obstructive CAD based on the 2021 Predictive Risk scorE for CAD In Southeast Asians with chEst pain (PRECISE) clinical model.
Examples
# 40 year old female with typical chest pain
# radiating to the neck, has diabetes
# but no hypertension and a non-smoker.
# She has Q waves but no ST-T changes on ECG.
calculate_precise_2021_clinical_ptp(
age = 40,
sex = "female",
chest_pain_type = "typical",
have_neck_radiation = "yes",
have_diabetes = "yes",
have_hypertension = "no",
smoking_history_type = "none",
have_q_waves = "yes",
have_st_t_changes = "no"
)
Calculate 2021 PRECISE Simple PTP for obstructive CAD
Description
This function returns a patient's pre-test probability (PTP) of obstructive coronary artery disease based on the 2021 Predictive Risk scorE for CAD In Southeast Asians with chEst pain (PRECISE) simple model.
Usage
calculate_precise_2021_simple_ptp(
age,
sex,
chest_pain_type,
have_neck_radiation,
have_diabetes,
have_hypertension,
smoking_history_type,
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
label_cpt_nonanginal = c("nonanginal"),
label_cpt_atypical = c("atypical"),
label_cpt_typical = c("typical"),
label_cpt_unknown = c(NA, NaN),
label_have_neck_radiation_no = c("no"),
label_have_neck_radiation_yes = c("yes"),
label_have_neck_radiation_unknown = c(NA, NaN),
label_have_diabetes_no = c("no"),
label_have_diabetes_yes = c("yes"),
label_have_diabetes_unknown = c(NA, NaN),
label_have_hypertension_no = c("no"),
label_have_hypertension_yes = c("yes"),
label_have_hypertension_unknown = c(NA, NaN),
label_smoking_history_type_current = c("current"),
label_smoking_history_type_past = c("past"),
label_smoking_history_type_none = c("none"),
label_smoking_history_type_unknown = c(NA, NaN)
)
Arguments
age |
Input numeric value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
chest_pain_type |
The value of variable in the parameters,
|
have_neck_radiation |
The value of variable in the parameters
|
have_diabetes |
The value of variable in the parameters
|
have_hypertension |
The value of variable in the parameters
|
smoking_history_type |
The value of variable in the parameters
|
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
label_cpt_nonanginal |
Label(s) for patient having nonanginal or non-specific chest pain.
Default: |
label_cpt_atypical |
Label(s) for patient having atypical chest pain.
Default: |
label_cpt_typical |
Label(s) for patient having typical chest pain.
Default: |
label_cpt_unknown |
Label(s) for patient having unknown chest pain type symptoms.
Default: |
label_have_neck_radiation_no |
Label(s) for patient without
chest pain radiating to the neck.
Default: |
label_have_neck_radiation_yes |
Label(s) for patient with
chest pain radiating to the neck.
Default: |
label_have_neck_radiation_unknown |
Label(s) for patient with unknown
chest pain radiating to the neck
Default: |
label_have_diabetes_no |
Label(s) for patient with no diabetes.
Default: |
label_have_diabetes_yes |
Label(s) for patient having diabetes.
Default: |
label_have_diabetes_unknown |
Label(s) for patient
having unknown diabetes.
Default: |
label_have_hypertension_no |
Label(s) for patient with no hypertension.
Default: |
label_have_hypertension_yes |
Label(s) for patient having hypertension.
Default: |
label_have_hypertension_unknown |
Label(s) for patient
having unknown hypertension.
Default: |
label_smoking_history_type_current |
Label(s) for patient who is a current smoker.
Default: |
label_smoking_history_type_past |
Label(s) for patient who is a past smoker.
Default: |
label_smoking_history_type_none |
Label(s) for patient who is a non-smoker.
Default: |
label_smoking_history_type_unknown |
Label(s) for patient with unknown smoking history.
Default: |
Details
The predictive model is based on patients a mixed Asian cohort within Singapore with stable chest pain.
Value
A numeric value representing the patient's PTP for obstructive CAD based on the 2021 Predictive Risk scorE for CAD In Southeast Asians with chEst pain (PRECISE) simple model.
Examples
# 40 year old female with typical chest pain
# radiating to the neck, has diabetes
# but no hypertension and a non-smoker
calculate_precise_2021_simple_ptp(
age = 40,
sex = "female",
chest_pain_type = "typical",
have_neck_radiation = "yes",
have_diabetes = "yes",
have_hypertension = "no",
smoking_history_type = "none"
)
Calculate 2017 PROMISE Minimal-Risk Score for obstructive CAD
Description
This function returns a symptomatic (have chest pain or dyspnoea) patient's minimal risk score for obstructive coronary artery disease based on the 2017 PROMISE Minimal-Risk Score.
Usage
calculate_prms_2017_ptp(
age,
sex,
hdl_mg_dl,
is_minority_ethnicity,
have_diabetes,
have_hypertension,
have_dyslipidemia,
have_smoking_history,
have_family_history,
have_stress_symptoms = NA,
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
label_is_minority_ethnicity_no = c("no"),
label_is_minority_ethnicity_yes = c("yes"),
label_is_minority_ethnicity_unknown = c(NA, NaN),
label_have_diabetes_no = c("no"),
label_have_diabetes_yes = c("yes"),
label_have_diabetes_unknown = c(NA, NaN),
label_have_hypertension_no = c("no"),
label_have_hypertension_yes = c("yes"),
label_have_hypertension_unknown = c(NA, NaN),
label_have_dyslipidemia_no = c("no"),
label_have_dyslipidemia_yes = c("yes"),
label_have_dyslipidemia_unknown = c(NA, NaN),
label_have_smoking_history_no = c("no"),
label_have_smoking_history_yes = c("yes"),
label_have_smoking_history_unknown = c(NA, NaN),
label_have_family_history_no = c("no"),
label_have_family_history_yes = c("yes"),
label_have_family_history_unknown = c(NA, NaN),
label_have_stress_symptoms_no = c("no"),
label_have_stress_symptoms_yes = c("yes"),
label_have_stress_symptoms_unknown = c(NA, NaN)
)
Arguments
age |
Input numeric value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
hdl_mg_dl |
Input positive numeric value to indicate the
patient's high-density lipoprotein (HDL) in |
is_minority_ethnicity |
The value of variable in the parameters
|
have_diabetes |
The value of variable in the parameters
|
have_hypertension |
The value of variable in the parameters
|
have_dyslipidemia |
The value of variable in the parameters
|
have_smoking_history |
The value of variable in the parameters
|
have_family_history |
The value of variable in the parameters
|
have_stress_symptoms |
The value of variable in the parameters
|
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
label_is_minority_ethnicity_no |
Label(s) for patient not from a
racial or minority ethnicity (or patient is a non-Hispanic/Latino White).
Default: |
label_is_minority_ethnicity_yes |
Label(s) for patient from a
racial or minority ethnicity (or patient is not a non-Hispanic/Latino White).
E.g. Blacks, Asians, etc.
Default: |
label_is_minority_ethnicity_unknown |
Label(s) for patient from an unknown ethnicity
Default: |
label_have_diabetes_no |
Label(s) for patient with no diabetes.
Default: |
label_have_diabetes_yes |
Label(s) for patient having diabetes.
Default: |
label_have_diabetes_unknown |
Label(s) for patient
having unknown diabetes.
Default: |
label_have_hypertension_no |
Label(s) for patient with no hypertension.
Default: |
label_have_hypertension_yes |
Label(s) for patient having hypertension.
Default: |
label_have_hypertension_unknown |
Label(s) for patient
having unknown hypertension.
Default: |
label_have_dyslipidemia_no |
Label(s) for patient with no dyslipidemia.
Default: |
label_have_dyslipidemia_yes |
Label(s) for patient having dyslipidemia.
Default: |
label_have_dyslipidemia_unknown |
Label(s) for patient
having unknown dyslipidemia.
Default: |
label_have_smoking_history_no |
Label(s) for patient with
no smoking history (current or past).
Default: |
label_have_smoking_history_yes |
Label(s) for patient having
smoking history (current or past).
Default: |
label_have_smoking_history_unknown |
Label(s) for patient
having unknown smoking history (current or past).
Default: |
label_have_family_history_no |
Label(s) for patient with no family history of CAD.
Default: |
label_have_family_history_yes |
Label(s) for patient having family history of CAD.
Default: |
label_have_family_history_unknown |
Label(s) for patient
having unknown family history of CAD.
Default: |
label_have_stress_symptoms_no |
Label(s) for patient with
no symptoms (negative results) related to physical or mental stress.
Default: |
label_have_stress_symptoms_yes |
Label(s) for patient with
symptoms (positive results) related to physical or mental stress.
Default: |
label_have_stress_symptoms_unknown |
Label(s) for patient with
inconclusive results or patient has not taken any stress test
Default: |
Details
The predictive model is based on CCTA images from 4632 patients in the Prospective Multicenter imaging Study for Evaluation of Chest Pain (PROMISE) trial.
Value
A numeric value representing the patient's minimal risk score for obstructive CAD based on the 2017 PROMISE Minimal-Risk Score.
Examples
# 50 year old white female with chest pain
# a medical history of hypertension, and a
# high-density lipoprotein cholesterol level of 70 mg/dL
calculate_prms_2017_ptp(
age = 50,
sex = "female",
hdl_mg_dl = 70,
is_minority_ethnicity = "no",
have_diabetes = "no",
have_hypertension = "yes",
have_dyslipidemia = "no",
have_smoking_history = "no",
have_family_history = "no",
have_stress_symptoms = "no"
)
# 40 year old non-white male with chest pain
# a medical history of diabetes, unknown stress symptoms and a
# high-density lipoprotein cholesterol level of 70 mg/dL
calculate_prms_2017_ptp(
age = 40,
sex = "male",
hdl_mg_dl = 70,
is_minority_ethnicity = "yes",
have_diabetes = "yes",
have_hypertension = "no",
have_dyslipidemia = "no",
have_smoking_history = "no",
have_family_history = "no",
have_stress_symptoms = NA
)
Calculate 2019 Reeh Basic PTP for obstructive CAD
Description
This function returns a patient's pre-test probability (PTP) of obstructive coronary artery disease based on the 2019 Reeh et. al. basic model.
Usage
calculate_reeh_2019_basic_ptp(
age,
sex,
symptom_type,
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
label_symptom_type_typical = c("typical"),
label_symptom_type_atypical = c("atypical"),
label_symptom_type_nonanginal = c("nonanginal"),
label_symptom_type_dyspnoea = c("dyspnoea"),
label_symptom_type_unknown = c(NA, NaN)
)
Arguments
age |
Input numeric value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
symptom_type |
Input characters (typical, atypical, nonanginal, dyspnoea) to indicate the symptom characteristics of the patient.
|
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
label_symptom_type_typical |
Label(s) for patient having typical chest pain.
Default: |
label_symptom_type_atypical |
Label(s) for patient having atypical chest pain.
Default: |
label_symptom_type_nonanginal |
Label(s) for patient having nonanginal
or non-specific chest pain.
Default: |
label_symptom_type_dyspnoea |
Label(s) for patient having dyspnoea.
Default: |
label_symptom_type_unknown |
Label(s) for patient having unknown symptoms.
Default: |
Details
The predictive model is based on 3903 patients free of CAD and heart failure and suspected of angina, who were referred to a single, large, urban university hospital for assessment in 2012–15.
Value
A numeric value representing the patient's PTP for obstructive CAD based on the 2019 Reeh et. al. basic model.
Examples
# 40 year old female with typical chest pain
calculate_reeh_2019_basic_ptp(
age = 40,
sex = "female",
symptom_type = "typical"
)
Calculate 2019 Reeh Clinical PTP for obstructive CAD
Description
This function returns a patient's pre-test probability (PTP) of obstructive coronary artery disease based on the 2019 Reeh et. al. clinical model.
Usage
calculate_reeh_2019_clinical_ptp(
age,
sex,
symptom_type,
have_dyslipidemia,
have_family_history,
have_diabetes,
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
label_symptom_type_typical = c("typical"),
label_symptom_type_atypical = c("atypical"),
label_symptom_type_nonanginal = c("nonanginal"),
label_symptom_type_dyspnoea = c("dyspnoea"),
label_symptom_type_unknown = c(NA, NaN),
label_have_dyslipidemia_no = c("no"),
label_have_dyslipidemia_yes = c("yes"),
label_have_dyslipidemia_unknown = c(NA, NaN),
label_have_family_history_no = c("no"),
label_have_family_history_yes = c("yes"),
label_have_family_history_unknown = c(NA, NaN),
label_have_diabetes_no = c("no"),
label_have_diabetes_yes = c("yes"),
label_have_diabetes_unknown = c(NA, NaN)
)
Arguments
age |
Input numeric value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
symptom_type |
Input characters (typical, atypical, nonanginal, dyspnoea) to indicate the symptom characteristics of the patient.
|
have_dyslipidemia |
The value of variable in the parameters
|
have_family_history |
The value of variable in the parameters
|
have_diabetes |
The value of variable in the parameters
|
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
label_symptom_type_typical |
Label(s) for patient having typical chest pain.
Default: |
label_symptom_type_atypical |
Label(s) for patient having atypical chest pain.
Default: |
label_symptom_type_nonanginal |
Label(s) for patient having nonanginal
or non-specific chest pain.
Default: |
label_symptom_type_dyspnoea |
Label(s) for patient having dyspnoea.
Default: |
label_symptom_type_unknown |
Label(s) for patient having unknown symptoms.
Default: |
label_have_dyslipidemia_no |
Label(s) for patient with no dyslipidemia.
Default: |
label_have_dyslipidemia_yes |
Label(s) for patient having dyslipidemia.
Default: |
label_have_dyslipidemia_unknown |
Label(s) for patient
having unknown dyslipidemia.
Default: |
label_have_family_history_no |
Label(s) for patient with no family history of CAD.
Default: |
label_have_family_history_yes |
Label(s) for patient having family history of CAD.
Default: |
label_have_family_history_unknown |
Label(s) for patient
having unknown family history of CAD.
Default: |
label_have_diabetes_no |
Label(s) for patient with no diabetes.
Default: |
label_have_diabetes_yes |
Label(s) for patient having diabetes.
Default: |
label_have_diabetes_unknown |
Label(s) for patient
having unknown diabetes.
Default: |
Details
The predictive model is based on 3903 patients free of CAD and heart failure and suspected of angina, who were referred to a single, large, urban university hospital for assessment in 2012–15.
Value
A numeric value representing the patient's PTP for obstructive CAD based on the 2019 Reeh et. al. clinical model.
Examples
# 40 year old female with typical chest pain
calculate_reeh_2019_clinical_ptp(
age = 40,
sex = "female",
symptom_type = "typical",
have_dyslipidemia = "no",
have_family_history = "no",
have_diabetes = "no"
)
Calculate 2020 Winther Basic PTP for obstructive CAD
Description
This function returns a patient's pre-test probability (PTP) of obstructive coronary artery disease based on the 2020 Winther et. al. basic model (Basic_PTP).
Usage
calculate_winther_2020_basic_ptp(
age,
sex,
chest_pain_type,
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
label_cpt_no_chest_pain = c("no chest pain"),
label_cpt_nonanginal = c("nonanginal"),
label_cpt_atypical = c("atypical"),
label_cpt_typical = c("typical"),
label_cpt_unknown = c(NA, NaN)
)
Arguments
age |
Input numeric value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
chest_pain_type |
The value of variable in the parameters |
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
label_cpt_no_chest_pain |
Label(s) for patient having no chest pain.
Default: |
label_cpt_nonanginal |
Label(s) for patient having nonanginal or non-specific chest pain.
Default: |
label_cpt_atypical |
Label(s) for patient having atypical chest pain.
Default: |
label_cpt_typical |
Label(s) for patient having typical chest pain.
Default: |
label_cpt_unknown |
Label(s) for patient having unknown chest pain type symptoms.
Default: |
Details
The predictive model is based on > 40000 symptomatic patients from 2008 to 2017 from 13 hospitals in Western Denmark. These patients are registered under the Western Denmark Heart Registry.
Value
A numeric value representing the patient's PTP for obstructive CAD based on the 2020 Winther et. al. basic model (Basic_PTP).
Examples
# 40 year old Male with typical chest pain
calculate_winther_2020_basic_ptp(
age = 40,
sex = "male",
chest_pain_type = "typical"
)
# 40 year old Male with nonanginal chest pain
calculate_winther_2020_basic_ptp(
age = 40,
sex = "male",
chest_pain_type = "nonanginal"
)
Calculate 2020 Winther CACS-CL PTP model for obstructive CAD
Description
This function returns a patient's pre-test probability (PTP) of obstructive coronary artery disease based on 2020 Winther et. al. Coronary Artery Calcium Score-Weighted Clinical Likelihood (CACS-CL) model.
Usage
calculate_winther_2020_cacs_cl_ptp(
age,
sex,
chest_pain_type,
have_dyspnoea,
have_family_history,
have_smoking_history,
have_dyslipidemia,
have_hypertension,
have_diabetes,
coronary_calcium_score,
allow_na_symptom_score = TRUE,
max_na_num_of_rf = 0,
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
label_have_dyspnoea_no = c("no"),
label_have_dyspnoea_yes = c("yes"),
label_have_dyspnoea_unknown = c(NA, NaN),
label_cpt_no_chest_pain = c("no chest pain"),
label_cpt_nonanginal = c("nonanginal"),
label_cpt_atypical = c("atypical"),
label_cpt_typical = c("typical"),
label_cpt_unknown = c(NA, NaN),
label_have_family_history_no = c("no"),
label_have_family_history_yes = c("yes"),
label_have_family_history_unknown = c(NA, NaN),
label_have_smoking_history_no = c("no"),
label_have_smoking_history_yes = c("yes"),
label_have_smoking_history_unknown = c(NA, NaN),
label_have_dyslipidemia_no = c("no"),
label_have_dyslipidemia_yes = c("yes"),
label_have_dyslipidemia_unknown = c(NA, NaN),
label_have_hypertension_no = c("no"),
label_have_hypertension_yes = c("yes"),
label_have_hypertension_unknown = c(NA, NaN),
label_have_diabetes_no = c("no"),
label_have_diabetes_yes = c("yes"),
label_have_diabetes_unknown = c(NA, NaN)
)
Arguments
age |
Input numeric value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
chest_pain_type |
The value of variable in the parameters |
have_dyspnoea |
The value of variable in the parameters |
have_family_history |
The value of variable in the parameters
|
have_smoking_history |
The value of variable in the parameters
|
have_dyslipidemia |
The value of variable in the parameters
|
have_hypertension |
The value of variable in the parameters
|
have_diabetes |
The value of variable in the parameters
|
coronary_calcium_score |
Input non-negative numeric to indicate the total coronary calcium score of the patient. |
allow_na_symptom_score |
A logical evaluating to |
max_na_num_of_rf |
Input integer 0 to 5 to indicate the maximum number of
missing risk factors to tolerate before outputting an |
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
label_have_dyspnoea_no |
Label(s) for patient having no dyspnoea symptoms.
Default: |
label_have_dyspnoea_yes |
Label(s) for patient having dyspnoea symptoms.
Default: |
label_have_dyspnoea_unknown |
Label(s) for patient having unknown dyspnoea symptoms.
Default: |
label_cpt_no_chest_pain |
Label(s) for patient having no chest pain.
Default: |
label_cpt_nonanginal |
Label(s) for patient having nonanginal or non-specific chest pain.
Default: |
label_cpt_atypical |
Label(s) for patient having atypical chest pain.
Default: |
label_cpt_typical |
Label(s) for patient having typical chest pain.
Default: |
label_cpt_unknown |
Label(s) for patient having unknown chest pain type symptoms.
Default: |
label_have_family_history_no |
Label(s) for patient with no family history of CAD.
Default: |
label_have_family_history_yes |
Label(s) for patient having family history of CAD.
Default: |
label_have_family_history_unknown |
Label(s) for patient
having unknown family history of CAD.
Default: |
label_have_smoking_history_no |
Label(s) for patient with
no smoking history (current or past).
Default: |
label_have_smoking_history_yes |
Label(s) for patient having
smoking history (current or past).
Default: |
label_have_smoking_history_unknown |
Label(s) for patient
having unknown smoking history (current or past).
Default: |
label_have_dyslipidemia_no |
Label(s) for patient with no dyslipidemia.
Default: |
label_have_dyslipidemia_yes |
Label(s) for patient having dyslipidemia.
Default: |
label_have_dyslipidemia_unknown |
Label(s) for patient
having unknown dyslipidemia.
Default: |
label_have_hypertension_no |
Label(s) for patient with no hypertension.
Default: |
label_have_hypertension_yes |
Label(s) for patient having hypertension.
Default: |
label_have_hypertension_unknown |
Label(s) for patient
having unknown hypertension.
Default: |
label_have_diabetes_no |
Label(s) for patient with no diabetes.
Default: |
label_have_diabetes_yes |
Label(s) for patient having diabetes.
Default: |
label_have_diabetes_unknown |
Label(s) for patient
having unknown diabetes.
Default: |
Details
The predictive model is based on > 40000 symptomatic patients from 2008 to 2017 from 13 hospitals in Western Denmark. These patients are registered under the Western Denmark Heart Registry.
Value
A numeric value representing the patient's PTP for obstructive CAD based on the 2020 Winther et. al. Coronary Artery Calcium Score-Weighted Clinical Likelihood (CACS-CL) model.
Examples
# 40 year old Male with nonanginal chest pain and coronary calcium score of 0
calculate_winther_2020_cacs_cl_ptp(
age = 40,
sex = "male",
chest_pain_type = "no chest pain",
have_dyspnoea = "no",
have_family_history = "no",
have_smoking_history = "no",
have_dyslipidemia = "no",
have_hypertension = "no",
have_diabetes = "no",
coronary_calcium_score = 0,
allow_na_symptom_score = TRUE,
max_na_num_of_rf = 0
)
Calculate 2020 Winther RF-CL PTP model for obstructive CAD
Description
This function returns a patient's pre-test probability (PTP) of obstructive coronary artery disease based on the 2020 Winther et. al. Risk Factor-Weighted Clinical Likelihood (RF-CL) model.
Usage
calculate_winther_2020_rf_cl_ptp(
age,
sex,
chest_pain_type,
have_dyspnoea,
have_family_history,
have_smoking_history,
have_dyslipidemia,
have_hypertension,
have_diabetes,
allow_na_symptom_score = TRUE,
max_na_num_of_rf = 0,
label_sex_male = c("male"),
label_sex_female = c("female"),
label_sex_unknown = c(NA, NaN),
label_have_dyspnoea_no = c("no"),
label_have_dyspnoea_yes = c("yes"),
label_have_dyspnoea_unknown = c(NA, NaN),
label_cpt_no_chest_pain = c("no chest pain"),
label_cpt_nonanginal = c("nonanginal"),
label_cpt_atypical = c("atypical"),
label_cpt_typical = c("typical"),
label_cpt_unknown = c(NA, NaN),
label_have_family_history_no = c("no"),
label_have_family_history_yes = c("yes"),
label_have_family_history_unknown = c(NA, NaN),
label_have_smoking_history_no = c("no"),
label_have_smoking_history_yes = c("yes"),
label_have_smoking_history_unknown = c(NA, NaN),
label_have_dyslipidemia_no = c("no"),
label_have_dyslipidemia_yes = c("yes"),
label_have_dyslipidemia_unknown = c(NA, NaN),
label_have_hypertension_no = c("no"),
label_have_hypertension_yes = c("yes"),
label_have_hypertension_unknown = c(NA, NaN),
label_have_diabetes_no = c("no"),
label_have_diabetes_yes = c("yes"),
label_have_diabetes_unknown = c(NA, NaN)
)
Arguments
age |
Input numeric value to indicate the age of the patient in years. |
sex |
The value of variable in the parameters |
chest_pain_type |
The value of variable in the parameters |
have_dyspnoea |
The value of variable in the parameters |
have_family_history |
The value of variable in the parameters
|
have_smoking_history |
The value of variable in the parameters
|
have_dyslipidemia |
The value of variable in the parameters
|
have_hypertension |
The value of variable in the parameters
|
have_diabetes |
The value of variable in the parameters
|
allow_na_symptom_score |
A logical evaluating to |
max_na_num_of_rf |
Input integer 0 to 5 to indicate the maximum number of
missing risk factors to tolerate before outputting an |
label_sex_male |
Label(s) for definition(s) of male sex.
Default: |
label_sex_female |
Label(s) for definition(s) of female sex.
Default: |
label_sex_unknown |
Label(s) for definition(s) of missing sex.
Default: |
label_have_dyspnoea_no |
Label(s) for patient having no dyspnoea symptoms.
Default: |
label_have_dyspnoea_yes |
Label(s) for patient having dyspnoea symptoms.
Default: |
label_have_dyspnoea_unknown |
Label(s) for patient having unknown dyspnoea symptoms.
Default: |
label_cpt_no_chest_pain |
Label(s) for patient having no chest pain.
Default: |
label_cpt_nonanginal |
Label(s) for patient having nonanginal or non-specific chest pain.
Default: |
label_cpt_atypical |
Label(s) for patient having atypical chest pain.
Default: |
label_cpt_typical |
Label(s) for patient having typical chest pain.
Default: |
label_cpt_unknown |
Label(s) for patient having unknown chest pain type symptoms.
Default: |
label_have_family_history_no |
Label(s) for patient with no family history of CAD.
Default: |
label_have_family_history_yes |
Label(s) for patient having family history of CAD.
Default: |
label_have_family_history_unknown |
Label(s) for patient
having unknown family history of CAD.
Default: |
label_have_smoking_history_no |
Label(s) for patient with
no smoking history (current or past).
Default: |
label_have_smoking_history_yes |
Label(s) for patient having
smoking history (current or past).
Default: |
label_have_smoking_history_unknown |
Label(s) for patient
having unknown smoking history (current or past).
Default: |
label_have_dyslipidemia_no |
Label(s) for patient with no dyslipidemia.
Default: |
label_have_dyslipidemia_yes |
Label(s) for patient having dyslipidemia.
Default: |
label_have_dyslipidemia_unknown |
Label(s) for patient
having unknown dyslipidemia.
Default: |
label_have_hypertension_no |
Label(s) for patient with no hypertension.
Default: |
label_have_hypertension_yes |
Label(s) for patient having hypertension.
Default: |
label_have_hypertension_unknown |
Label(s) for patient
having unknown hypertension.
Default: |
label_have_diabetes_no |
Label(s) for patient with no diabetes.
Default: |
label_have_diabetes_yes |
Label(s) for patient having diabetes.
Default: |
label_have_diabetes_unknown |
Label(s) for patient
having unknown diabetes.
Default: |
Details
The predictive model is based on > 40000 symptomatic patients from 2008 to 2017 from 13 hospitals in Western Denmark. These patients are registered under the Western Denmark Heart Registry.
Value
A numeric value representing the patient's PTP for obstructive CAD based on the 2020 Winther et. al. Risk Factor-Weighted Clinical Likelihood (RF-CL) model.
Examples
# 40 year old Male with nonanginal chest pain
calculate_winther_2020_rf_cl_ptp(
age = 40,
sex = "male",
chest_pain_type = "no chest pain",
have_dyspnoea = "no",
have_family_history = "no",
have_smoking_history = "no",
have_dyslipidemia = "no",
have_hypertension = "no",
have_diabetes = "no",
allow_na_symptom_score = TRUE,
max_na_num_of_rf = 0
)
Check If Four Categories Are Mutually Exclusive
Description
Check if the four input categories are mutually exclusive from each other
Usage
check_if_four_categories_are_mutually_exclusive(
label_cat_1,
label_cat_2,
label_cat_3,
label_cat_4,
label_cat_missing = NULL,
arg_cat_1 = rlang::caller_arg(label_cat_1),
arg_cat_2 = rlang::caller_arg(label_cat_2),
arg_cat_3 = rlang::caller_arg(label_cat_3),
arg_cat_4 = rlang::caller_arg(label_cat_4),
arg_cat_missing = rlang::caller_arg(label_cat_missing),
error_call = rlang::caller_env()
)
Arguments
label_cat_1 |
First vector to check for mutually exclusiveness with another vector. |
label_cat_2 |
Second vector to check for mutually exclusiveness with another vector. |
label_cat_3 |
Third vector to check for mutually exclusiveness with another vector |
label_cat_4 |
Fourth vector to check for mutually exclusiveness with another vector |
label_cat_missing |
Missing values vector to check for mutually exclusiveness with another vector if needed. Default: NULL |
arg_cat_1 |
An argument name as a string for the first vector. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
arg_cat_2 |
An argument name as a string for the second vector. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
arg_cat_3 |
An argument name as a string for the third vector. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
arg_cat_4 |
An argument name as a string for the fourth vector. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
arg_cat_missing |
An argument name as a string for the missing values vector. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
error_call |
The execution environment of a currently
running function, e.g. |
Value
An error message if the four input categories are not mutually exclusive
See Also
caller_arg
, stack
cli_vec
, cli_abort
Examples
# No error
cat_1 <- c("no chest pain")
cat_2 <- c("typical")
cat_3 <- c("atypical")
cat_4 <- c("nonanginal")
cat_missing <- c("NA")
check_if_four_categories_are_mutually_exclusive(cat_1, cat_2, cat_3, cat_4)
check_if_four_categories_are_mutually_exclusive(cat_1, cat_2, cat_3, cat_4, cat_missing)
# Common labels found
cat_1 <- c("no chest pain","typical", "atypical", "nonanginal")
cat_2 <- c("no chest pain","typical", "atypical", "nonanginal")
cat_3 <- c("no chest pain","typical", "atypical", "nonanginal")
cat_4 <- c("no chest pain","typical", "atypical", "nonanginal")
cat_missing <- c("no chest pain","typical", "atypical", "nonanginal")
try(check_if_four_categories_are_mutually_exclusive(cat_1, cat_2, cat_3, cat_4))
try(check_if_four_categories_are_mutually_exclusive(cat_1, cat_2, cat_3, cat_4, cat_missing))
Check If Integer
Description
Check if the input variable is an integer
Usage
check_if_integer(
x,
allow_na = TRUE,
arg = rlang::caller_arg(x),
error_call = rlang::caller_env()
)
Arguments
x |
Input variable to check if it is an integer |
allow_na |
Input boolean to determine if |
arg |
An argument name as a string. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
error_call |
The execution environment of a currently
running function, e.g. |
Value
The variable itself or an error message if variable is not non-negative
See Also
Examples
# No error
input = 0
try(check_if_integer(input))
# Error as 5.5 is not an integer
input = 5.5
try(check_if_integer(input))
Check If Non-Negative
Description
Check if the input variable is a non-negative number
Usage
check_if_non_negative(
x,
allow_na = TRUE,
arg = rlang::caller_arg(x),
error_call = rlang::caller_env()
)
Arguments
x |
Input variable to check if it is non-negative number |
allow_na |
Input boolean to determine if |
arg |
An argument name as a string. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
error_call |
The execution environment of a currently
running function, e.g. |
Value
The variable itself or an error message if variable is not non-negative
See Also
Examples
# No error
input = 0
try(check_if_non_negative(input))
# Error as -5 is not a non-neagtive number
input = -5
try(check_if_non_negative(input))
Check If Numeric
Description
Check if the input variable is numeric
Usage
check_if_numeric(
x,
allow_na = TRUE,
arg = rlang::caller_arg(x),
error_call = rlang::caller_env()
)
Arguments
x |
Input variable to check if it is numeric |
allow_na |
Input boolean to determine if |
arg |
An argument name as a string. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
error_call |
The execution environment of a currently
running function, e.g. |
Value
The variable itself or an error message if variable is not numeric
See Also
Examples
# No error
input = 1
try(check_if_numeric(input))
# Error as "5" is not numeric
input = "5"
try(check_if_numeric(input))
# Error as NULL is not numeric
input = NULL
try(check_if_numeric(input))
# Error as NA is not numeric and allow_na is FALSE
input = NA
try(check_if_numeric(input, allow_na = FALSE))
Check If Positive
Description
Check if the input variable is a positive number
Usage
check_if_positive(
x,
allow_na = TRUE,
arg = rlang::caller_arg(x),
error_call = rlang::caller_env()
)
Arguments
x |
Input variable to check if it is positive number |
allow_na |
Input boolean to determine if |
arg |
An argument name as a string. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
error_call |
The execution environment of a currently
running function, e.g. |
Value
The variable itself or an error message if variable is not positive
See Also
Examples
# No error
input = 1
try(check_if_positive(input))
# Error as 0 is not a positive number
input = 0
try(check_if_positive(input))
# Error as -5 is not a positive number
input = -5
try(check_if_positive(input))
Check If Three Categories Are Mutually Exclusive
Description
Check if the three input categories are mutually exclusive from each other
Usage
check_if_three_categories_are_mutually_exclusive(
label_cat_1,
label_cat_2,
label_cat_3,
label_cat_missing = NULL,
arg_cat_1 = rlang::caller_arg(label_cat_1),
arg_cat_2 = rlang::caller_arg(label_cat_2),
arg_cat_3 = rlang::caller_arg(label_cat_3),
arg_cat_missing = rlang::caller_arg(label_cat_missing),
error_call = rlang::caller_env()
)
Arguments
label_cat_1 |
First vector to check for mutually exclusiveness with another vector. |
label_cat_2 |
Second vector to check for mutually exclusiveness with another vector. |
label_cat_3 |
Third vector to check for mutually exclusiveness with another vector |
label_cat_missing |
Missing values vector to check for mutually exclusiveness with another vector if needed. Default: NULL |
arg_cat_1 |
An argument name as a string for the first vector. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
arg_cat_2 |
An argument name as a string for the second vector. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
arg_cat_3 |
An argument name as a string for the third vector. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
arg_cat_missing |
An argument name as a string for the missing values vector. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
error_call |
The execution environment of a currently
running function, e.g. |
Value
An error message if the three input categories are not mutually exclusive
See Also
caller_arg
, stack
cli_vec
, cli_abort
Examples
# No error
cat_1 <- c("typical")
cat_2 <- c("atypical")
cat_3 <- c("nonanginal")
cat_missing <- c("NA")
check_if_three_categories_are_mutually_exclusive(cat_1, cat_2, cat_3)
check_if_three_categories_are_mutually_exclusive(cat_1, cat_2, cat_3, cat_missing)
# Common labels found
cat_1 <- c("typical", "atypical", "nonanginal", "NA")
cat_2 <- c("typical", "atypical", "nonanginal", "NA")
cat_3 <- c("typical", "atypical", "nonanginal", "NA")
cat_missing <- c("typical", "atypical", "nonanginal", "NA")
try(check_if_three_categories_are_mutually_exclusive(cat_1, cat_2, cat_3))
try(check_if_three_categories_are_mutually_exclusive(cat_1, cat_2, cat_3, cat_missing))
Check If Two Categories Are Mutually Exclusive
Description
Check if the two input categories are mutually exclusive from each other
Usage
check_if_two_categories_are_mutually_exclusive(
label_cat_1,
label_cat_2,
label_cat_missing = NULL,
arg_cat_1 = rlang::caller_arg(label_cat_1),
arg_cat_2 = rlang::caller_arg(label_cat_2),
arg_cat_missing = rlang::caller_arg(label_cat_missing),
error_call = rlang::caller_env()
)
Arguments
label_cat_1 |
First vector to check for mutually exclusiveness with another vector. |
label_cat_2 |
Second vector to check for mutually exclusiveness with another vector. |
label_cat_missing |
Missing values vector to check for mutually exclusiveness with another vector if needed. Default: NULL |
arg_cat_1 |
An argument name as a string for the first vector. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
arg_cat_2 |
An argument name as a string for the second vector. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
arg_cat_missing |
An argument name as a string for the missing values vector. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
error_call |
The execution environment of a currently
running function, e.g. |
Value
An error message if the two input categories are not mutually exclusive
See Also
caller_arg
, stack
cli_vec
, cli_abort
Examples
# No error
cat_1 <- c("male")
cat_2 <- c("female")
cat_missing <- c("not saying")
check_if_two_categories_are_mutually_exclusive(cat_1, cat_2)
check_if_two_categories_are_mutually_exclusive(cat_1, cat_2, cat_missing)
# Common labels found
cat_1 <- c("male", "female", "not saying")
cat_2 <- c("male", "female", "not saying")
cat_missing <- c("male", "female", "not saying")
try(check_if_two_categories_are_mutually_exclusive(cat_1, cat_2))
try(check_if_two_categories_are_mutually_exclusive(cat_1, cat_2, cat_missing))
Quoted Characters
Description
Add a quote around characters.
Usage
chr_quoted(chr, type = "`")
Arguments
chr |
A character vector to add quotes in each element. (e.g. c("a", "b", "c")). |
type |
Character to be used as a quote. Default: ''' |
Details
DETAILS
Value
A character vector with quotes added in each element. (e.g. c("'a'", "'b'", "'c'")).
Examples
chr_quoted(c("a","b", "c"))
Harmonise Four Labels
Description
Function to map an input from four different list into one of the four standardise labels
Usage
harmonise_four_labels(
arg,
label_one,
label_two,
label_three,
label_four,
label_unknown,
harmonise_label_one = "group_1",
harmonise_label_two = "group_2",
harmonise_label_three = "group_3",
harmonise_label_four = "group_4",
harmonise_label_unknown = NA,
error_call = rlang::caller_env()
)
Arguments
arg |
Input argument, in characters to be harmonised |
label_one |
Input character vector representing the ways to identify |
label_two |
Input character vector representing the ways to identify |
label_three |
Input character vector representing the ways to identify |
label_four |
Input character vector representing the ways to identify |
label_unknown |
Input character vector representing the ways to identify |
harmonise_label_one |
Input character representing the harmonised label for |
harmonise_label_two |
Input character representing the harmonised label for |
harmonise_label_three |
Input character representing the harmonised label for |
harmonise_label_four |
Input character representing the harmonised label for |
harmonise_label_unknown |
Input character representing the harmonised label for |
error_call |
The execution environment of a currently
running function, e.g. |
Value
Character representing one of the four standardise labels.
Examples
label_cpt_no_chest_pain <- c("no chest pain", "normal")
label_cpt_nonanginal <- c("nonanginal", "unspecified")
label_cpt_atypical <- c("atypical", "Atypical")
label_cpt_typical <- c("typical", "angina")
label_cpt_unknown <- c(NA, NaN)
# Gives harmonise_label_one if there is valid input of chest_pain_type
chest_pain_type <- "normal"
harmonise_four_labels(
arg = chest_pain_type,
label_one = label_cpt_no_chest_pain,
label_two = label_cpt_nonanginal,
label_three = label_cpt_atypical,
label_four = label_cpt_typical,
label_unknown = label_cpt_unknown,
harmonise_label_one = "no chest pain",
harmonise_label_two = "nonanginal",
harmonise_label_three = "atypical",
harmonise_label_four = "typical",
harmonise_label_unknown = NA
)
# Gives harmonise_label_two if there is valid input of chest_pain_type
chest_pain_type <- "unspecified"
harmonise_four_labels(
arg = chest_pain_type,
label_one = label_cpt_no_chest_pain,
label_two = label_cpt_nonanginal,
label_three = label_cpt_atypical,
label_four = label_cpt_typical,
label_unknown = label_cpt_unknown,
harmonise_label_one = "no chest pain",
harmonise_label_two = "nonanginal",
harmonise_label_three = "atypical",
harmonise_label_four = "typical",
harmonise_label_unknown = NA
)
# Gives harmonise_label_three if there is valid input of chest_pain_type
chest_pain_type <- "Atypical"
harmonise_four_labels(
arg = chest_pain_type,
label_one = label_cpt_no_chest_pain,
label_two = label_cpt_nonanginal,
label_three = label_cpt_atypical,
label_four = label_cpt_typical,
label_unknown = label_cpt_unknown,
harmonise_label_one = "no chest pain",
harmonise_label_two = "nonanginal",
harmonise_label_three = "atypical",
harmonise_label_four = "typical",
harmonise_label_unknown = NA
)
# Gives harmonise_label_four if there is valid input of chest_pain_type
chest_pain_type <- "angina"
harmonise_four_labels(
arg = chest_pain_type,
label_one = label_cpt_no_chest_pain,
label_two = label_cpt_nonanginal,
label_three = label_cpt_atypical,
label_four = label_cpt_typical,
label_unknown = label_cpt_unknown,
harmonise_label_one = "no chest pain",
harmonise_label_two = "nonanginal",
harmonise_label_three = "atypical",
harmonise_label_four = "typical",
harmonise_label_unknown = NA
)
# Gives harmonise_label_unknown if there is valid missing input of chest_pain_type
chest_pain_type <- NaN
harmonise_four_labels(
arg = chest_pain_type,
label_one = label_cpt_no_chest_pain,
label_two = label_cpt_nonanginal,
label_three = label_cpt_atypical,
label_four = label_cpt_typical,
label_unknown = label_cpt_unknown,
harmonise_label_one = "no chest pain",
harmonise_label_two = "nonanginal",
harmonise_label_three = "atypical",
harmonise_label_four = "typical",
harmonise_label_unknown = NA
)
# Gives harmonise_label_unknown if there is valid missing input of chest_pain_type
chest_pain_type <- "NIL"
label_cpt_unknown <- c("NIL")
harmonise_four_labels(
arg = chest_pain_type,
label_one = label_cpt_no_chest_pain,
label_two = label_cpt_nonanginal,
label_three = label_cpt_atypical,
label_four = label_cpt_typical,
label_unknown = label_cpt_unknown,
harmonise_label_one = "no chest pain",
harmonise_label_two = "nonanginal",
harmonise_label_three = "atypical",
harmonise_label_four = "typical",
harmonise_label_unknown = NA
)
# Gives error of invalid typical chest pain input with partial match
chest_pain_type <- "Typical"
label_cpt_unknown <- c(NA, NaN)
try(harmonise_four_labels(
arg = chest_pain_type,
label_one = label_cpt_no_chest_pain,
label_two = label_cpt_nonanginal,
label_three = label_cpt_atypical,
label_four = label_cpt_typical,
label_unknown = label_cpt_unknown,
harmonise_label_one = "no chest pain",
harmonise_label_two = "nonanginal",
harmonise_label_three = "atypical",
harmonise_label_four = "typical",
harmonise_label_unknown = NA
))
# Gives error of invalid typical chest pain input without partial match
chest_pain_type <- "Something"
label_cpt_unknown <- c(NA, NaN)
try(harmonise_four_labels(
arg = chest_pain_type,
label_one = label_cpt_no_chest_pain,
label_two = label_cpt_nonanginal,
label_three = label_cpt_atypical,
label_four = label_cpt_typical,
label_unknown = label_cpt_unknown,
harmonise_label_one = "no chest pain",
harmonise_label_two = "nonanginal",
harmonise_label_three = "atypical",
harmonise_label_four = "typical",
harmonise_label_unknown = NA
))
# Gives error of invalid missing input of chest_pain_type
chest_pain_type <- NA
label_cpt_unknown <- c("NIL")
try(harmonise_four_labels(
arg = chest_pain_type,
label_one = label_cpt_no_chest_pain,
label_two = label_cpt_nonanginal,
label_three = label_cpt_atypical,
label_four = label_cpt_typical,
label_unknown = label_cpt_unknown,
harmonise_label_one = "no chest pain",
harmonise_label_two = "nonanginal",
harmonise_label_three = "atypical",
harmonise_label_four = "typical",
harmonise_label_unknown = NA
))
Harmonise Three Labels
Description
Function to map an input from three different list into one of the three standardise labels
Usage
harmonise_three_labels(
arg,
label_one,
label_two,
label_three,
label_unknown,
harmonise_label_one = "group_1",
harmonise_label_two = "group_2",
harmonise_label_three = "group_3",
harmonise_label_unknown = NA,
error_call = rlang::caller_env()
)
Arguments
arg |
Input argument, in characters to be harmonised |
label_one |
Input character vector representing the ways to identify |
label_two |
Input character vector representing the ways to identify |
label_three |
Input character vector representing the ways to identify |
label_unknown |
Input character vector representing the ways to identify |
harmonise_label_one |
Input character representing the harmonised label for |
harmonise_label_two |
Input character representing the harmonised label for |
harmonise_label_three |
Input character representing the harmonised label for |
harmonise_label_unknown |
Input character representing the harmonised label for |
error_call |
The execution environment of a currently
running function, e.g. |
Value
Character representing one of the three standardise labels.
Examples
label_cpt_nonanginal <- c("nonanginal", "unspecified")
label_cpt_atypical <- c("atypical", "Atypical")
label_cpt_typical <- c("typical", "angina")
label_cpt_unknown <- c(NA, NaN)
# Gives harmonise_label_one if there is valid input of chest_pain_type
chest_pain_type <- "unspecified"
harmonise_three_labels(
arg = chest_pain_type,
label_one = label_cpt_nonanginal,
label_two = label_cpt_atypical,
label_three = label_cpt_typical,
label_unknown = label_cpt_unknown,
harmonise_label_one = "nonanginal",
harmonise_label_two = "atypical",
harmonise_label_three = "typical",
harmonise_label_unknown = NA
)
# Gives harmonise_label_two if there is valid input of chest_pain_type
chest_pain_type <- "Atypical"
harmonise_three_labels(
arg = chest_pain_type,
label_one = label_cpt_nonanginal,
label_two = label_cpt_atypical,
label_three = label_cpt_typical,
label_unknown = label_cpt_unknown,
harmonise_label_one = "nonanginal",
harmonise_label_two = "atypical",
harmonise_label_three = "typical",
harmonise_label_unknown = NA
)
# Gives harmonise_label_three if there is valid input of chest_pain_type
chest_pain_type <- "angina"
harmonise_three_labels(
arg = chest_pain_type,
label_one = label_cpt_nonanginal,
label_two = label_cpt_atypical,
label_three = label_cpt_typical,
label_unknown = label_cpt_unknown,
harmonise_label_one = "nonanginal",
harmonise_label_two = "atypical",
harmonise_label_three = "typical",
harmonise_label_unknown = NA
)
# Gives harmonise_label_unknown if there is valid missing input of chest_pain_type
chest_pain_type <- NaN
harmonise_three_labels(
arg = chest_pain_type,
label_one = label_cpt_nonanginal,
label_two = label_cpt_atypical,
label_three = label_cpt_typical,
label_unknown = label_cpt_unknown,
harmonise_label_one = "nonanginal",
harmonise_label_two = "atypical",
harmonise_label_three = "typical",
harmonise_label_unknown = NA
)
# Gives harmonise_label_unknown if there is valid missing input of chest_pain_type
chest_pain_type <- "NIL"
label_cpt_unknown <- c("NIL")
harmonise_three_labels(
arg = chest_pain_type,
label_one = label_cpt_nonanginal,
label_two = label_cpt_atypical,
label_three = label_cpt_typical,
label_unknown = label_cpt_unknown,
harmonise_label_one = "nonanginal",
harmonise_label_two = "atypical",
harmonise_label_three = "typical",
harmonise_label_unknown = NA
)
# Gives error of invalid typical chest pain input with partial match
chest_pain_type <- "Typical"
label_cpt_unknown <- c(NA, NaN)
try(harmonise_three_labels(
arg = chest_pain_type,
label_one = label_cpt_nonanginal,
label_two = label_cpt_atypical,
label_three = label_cpt_typical,
label_unknown = label_cpt_unknown,
harmonise_label_one = "nonanginal",
harmonise_label_two = "atypical",
harmonise_label_three = "typical",
harmonise_label_unknown = NA
))
# Gives error of invalid typical chest pain input without partial match
chest_pain_type <- "Something"
label_cpt_unknown <- c(NA, NaN)
try(harmonise_three_labels(
arg = chest_pain_type,
label_one = label_cpt_nonanginal,
label_two = label_cpt_atypical,
label_three = label_cpt_typical,
label_unknown = label_cpt_unknown,
harmonise_label_one = "nonanginal",
harmonise_label_two = "atypical",
harmonise_label_three = "typical",
harmonise_label_unknown = NA
))
# Gives error of invalid missing input of chest_pain_type
chest_pain_type <- NA
label_cpt_unknown <- c("NIL")
try(harmonise_three_labels(
arg = chest_pain_type,
label_one = label_cpt_nonanginal,
label_two = label_cpt_atypical,
label_three = label_cpt_typical,
label_unknown = label_cpt_unknown,
harmonise_label_one = "nonanginal",
harmonise_label_two = "atypical",
harmonise_label_three = "typical",
harmonise_label_unknown = NA
))
Harmonise Two Labels
Description
Function to map an input from two different list into one of the two standardise labels
Usage
harmonise_two_labels(
arg,
label_one,
label_two,
label_unknown,
harmonise_label_one = "no",
harmonise_label_two = "yes",
harmonise_label_unknown = NA,
error_call = rlang::caller_env()
)
Arguments
arg |
Input argument, in characters to be harmonised |
label_one |
Input character vector representing the ways to identify |
label_two |
Input character vector representing the ways to identify |
label_unknown |
Input character vector representing the ways to identify |
harmonise_label_one |
Input character representing the harmonised label for |
harmonise_label_two |
Input character representing the harmonised label for |
harmonise_label_unknown |
Input character representing the harmonised label for |
error_call |
The execution environment of a currently
running function, e.g. |
Value
Character representing one of the two standardise labels.
Examples
label_have_dyspnoea_no <- c("no", "No")
label_have_dyspnoea_yes <- c("yes", "Yes")
label_have_dyspnoea_unknown <- c(NA, NaN)
# Gives harmonise_label_one if there is valid input of have_dyspnoea
have_dyspnoea <- "No"
harmonise_two_labels(
arg = have_dyspnoea,
label_one = label_have_dyspnoea_no,
label_two = label_have_dyspnoea_yes,
label_unknown = label_have_dyspnoea_unknown,
harmonise_label_one = "no",
harmonise_label_two = "yes",
harmonise_label_unknown = NA
)
# Gives harmonise_label_two if there is valid input of have_dyspnoea
have_dyspnoea <- "Yes"
harmonise_two_labels(
arg = have_dyspnoea,
label_one = label_have_dyspnoea_no,
label_two = label_have_dyspnoea_yes,
label_unknown = label_have_dyspnoea_unknown,
harmonise_label_one = "no",
harmonise_label_two = "yes",
harmonise_label_unknown = NA
)
# Gives harmonise_label_unknown if there is valid missing input of have_dyspnoea
have_dyspnoea <- NaN
harmonise_two_labels(
arg = have_dyspnoea,
label_one = label_have_dyspnoea_no,
label_two = label_have_dyspnoea_yes,
label_unknown = label_have_dyspnoea_unknown,
harmonise_label_one = "no",
harmonise_label_two = "yes",
harmonise_label_unknown = NA
)
# Gives harmonise_label_unknown if there is valid missing input of have_dyspnoea
have_dyspnoea <- "NIL"
label_have_dyspnoea_unknown <- c("NIL")
harmonise_two_labels(
arg = have_dyspnoea,
label_one = label_have_dyspnoea_no,
label_two = label_have_dyspnoea_yes,
label_unknown = label_have_dyspnoea_unknown,
harmonise_label_one = "no",
harmonise_label_two = "yes",
harmonise_label_unknown = NA
)
# Gives error of invalid have_dyspnoea input with partial match
have_dyspnoea <- "Not"
label_have_dyspnoea_unknown <- c(NA, NaN)
try(harmonise_two_labels(
arg = have_dyspnoea,
label_one = label_have_dyspnoea_no,
label_two = label_have_dyspnoea_yes,
label_unknown = label_have_dyspnoea_unknown,
harmonise_label_one = "no",
harmonise_label_two = "yes",
harmonise_label_unknown = NA
))
# Gives error of invalid have_dyspnoea input without partial match
have_dyspnoea <- "Something"
label_have_dyspnoea_unknown <- c(NA, NaN)
try(harmonise_two_labels(
arg = have_dyspnoea,
label_one = label_have_dyspnoea_no,
label_two = label_have_dyspnoea_yes,
label_unknown = label_have_dyspnoea_unknown,
harmonise_label_one = "no",
harmonise_label_two = "yes",
harmonise_label_unknown = NA
))
# Gives error of invalid missing input of have_dyspnoea
have_dyspnoea <- NA
label_have_dyspnoea_unknown <- c("NIL")
try(harmonise_two_labels(
arg = have_dyspnoea,
label_one = label_have_dyspnoea_no,
label_two = label_have_dyspnoea_yes,
label_unknown = label_have_dyspnoea_unknown,
harmonise_label_one = "no",
harmonise_label_two = "yes",
harmonise_label_unknown = NA
))
Is Integer Value
Description
Function to check if the input value is an integer.
Usage
is_integer_value(input_value, allow_na = FALSE)
Arguments
input_value |
The input value |
allow_na |
If true, NA values are ignored and output is considered TRUE. Default: FALSE |
Value
A boolean indicating TRUE when the input value is an integer and FALSE otherwise.
Examples
# An integer
is_integer_value(1)
# Not an integer
is_integer_value(1.1)
# Not numeric
is_integer_value("1")
# NA cases
is_integer_value(NA, allow_na = FALSE)
is_integer_value(NA, allow_na = TRUE)
Character Vector To List Phrase With Oxford Comma
Description
A function that converts a character vector into a list phrase that uses the Oxford comma.
Usage
oxford_comma(chr, sep = ", ", final = "or")
Arguments
chr |
A character vector to turn into a list phrase (e.g. c("a", "b", "c")). |
sep |
Separator symbols used to separate the elements in the character vector, Default: ', ' |
final |
String to use in place of the final separator when we have at least two elements in the character vector, Default: 'or'. |
Value
A string in the form of a list that has a comma if there are at least three elements in the list (e.g. "a, b, or c")
Examples
oxford_comma(c("James", "John", "Jeremy"))
oxford_comma(c("James", "John", "Jeremy"), final = "and")
oxford_comma(c("James", "John"))
oxford_comma(c("James"))
Round To Nearest Digit
Description
A function that does symmetric rounding to the nearest digits.
Usage
round_to_nearest_digit(number, digits = 0)
Arguments
number |
Input numeric value |
digits |
Input integer indicating the number of decimal places to be used. By default, it rounds off to the nearest integer. Default: 0 |
Value
A numeric value rounded off to a number of decimal places specified in
the input digits
.
Examples
round_to_nearest_digit(0.5)
round_to_nearest_digit(1.5)
round_to_nearest_digit(-0.5)
round_to_nearest_digit(-1.5)
round_to_nearest_digit(1021.125, digits = 2)