Takes a character vector as formated by pretty_ci and adds a user specified explanatory note; to be used inline.

pretty_inline_ci(string, note = "95% CI ", replace_bracket = TRUE)

Arguments

string

A character vector as formated by pretty_ci.

note

A character vector indicating the explanatory note to be used.

replace_bracket

Logical, defaults to TRUE. Should the leading bracket be automatically be reinserted in front of the custom note supplied by note.

Value

An estimate with formated CI's for use inline within a document.

See also

pretty_ci

Examples

## Use input from pretty_ci to generate a inline CI pretty_inline_ci(pretty_ci(2,1,3))
#> [1] "2.00 (95% CI 1.00 to 3.00)"
## Change note i.e for 90% credible intervals pretty_inline_ci(pretty_ci(2,1,3), note = '90% credible interval ')
#> [1] "2.00 (90% credible interval 1.00 to 3.00)"
## Handle vectorised input est <- c(1,2,3,10) lci <- c(0, -19, -209, -100) uci <- c(100, 30, 40, 19) formated_ci <- pretty_ci(est, lci, uci, sep = '-') pretty_inline_ci(formated_ci)
#> [1] "1.00 (95% CI 0.00-100.00)" "2.00 (95% CI -19.00-30.00)" #> [3] "3.00 (95% CI -209.00-40.00)" "10.00 (95% CI -100.00-19.00)"
## Add a note before the braket pretty_inline_ci(formated_ci, note = " per 100,000 (95% CI ", replace_bracket = FALSE)
#> [1] "1.00 per 100,000 (95% CI 0.00-100.00)" #> [2] "2.00 per 100,000 (95% CI -19.00-30.00)" #> [3] "3.00 per 100,000 (95% CI -209.00-40.00)" #> [4] "10.00 per 100,000 (95% CI -100.00-19.00)"