Create risk vector based on ratio, number of places, or data frame
Source:R/rv_create_risk_vector.R
rv_create_risk_vector.Rd
Create risk vector based on ratio, number of places, or data frame
Arguments
- 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.
Examples
rv_create_risk_vector(
risk_ratio = 0.1,
total_places = 100
)
table(
rv_create_risk_vector(
risk_ratio = 0.1,
total_places = 100
)
)
#>
#> 1
#> 10
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
)
)
#>
#> Hospitalization Death
#> 30 10