Description Usage Arguments Value Examples
View source: R/rv_create_risk_vector.R
Create risk vector based on ratio, number of places, or data frame
1 2 3 4 5 6 | rv_create_risk_vector(
risk_ratio,
total_places,
risk_places = NULL,
risk_names = NULL
)
|
risk_ratio |
A numeric vector or a data frame with two columns, 'Risk' and 'Ratio' |
total_places |
Numeric. Gives the total length of the output vector. |
risk_places |
A numeric vector or a data frame with two columns, 'Risk' and 'Places' |
risk_name |
If a numeric vector given in previous parameters, defines the name of the risk. |
A character vector with length equal to total_places.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | rv_create_risk_vector(risk_ratio = 0.1,
total_places = 100)
table(
rv_create_risk_vector(risk_ratio = 0.1,
total_places = 100)
)
ratio <- tibble::tribble(~Risk, ~Ratio,
"Hospitalization", 0.3,
"Death", 0.1)
rv_create_risk_vector(risk_ratio = ratio,
total_places = 100)
table(
rv_create_risk_vector(risk_ratio = ratio,
total_places = 100)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.