CVrisk

R build status Codecov test coverage

About the package

CVrisk is a package to calculate various cardiovascular disease risk scores.

Currently available risk scores

Coming soon

Installation

# Install the development version from GitHub:
# install.packages("devtools")
devtools::install_github("vcastro/CVRisk")

Usage

Calculate a single score:

library(CVrisk)
ascvd_10y_accaha(race = "aa", gender = "male", age = 55, 
   totchol = 213, hdl = 50, sbp = 140, 
   bp_med = FALSE, smoker=0, diabetes=0)
   

Calculate multiple scores for a dataframe of data and append scores to the dataframe:

library(dplyr)

sample_data %>% 
  compute_CVrisk(age = "age", race = "race", gender = "gender", bmi = "BMI", 
      sbp = "sbp", hdl = "hdl", totchol = "totchol", bp_med = "bp_med", 
      smoker = "smoker", diabetes = "diabetes")