If you have table values that take the form estimate (lower bound, upper bound), you can use these functions to access specific parts of the table value.
ci_drop(x, bracket_left = "(", bracket_right = ")") ci_extract(x, bracket_left = "(", bracket_right = ")", drop_bracket = FALSE) ci_lower_bound(x, bracket_left = "(", bracket_right = ")") ci_upper_bound(x, bracket_left = "(", bracket_right = ")")
x | a character vector where each value contains a point estimate and confidence limits |
---|---|
bracket_left | a character value specifying what symbol is used to bracket the left hand side of the confidence interval |
bracket_right | a character value specifying what symbol is used to bracket the right hand side of the confidence interval |
drop_bracket | a logical value ( |
separator | a character value specifying what symbol is used to separate the lower and upper bounds of the interval. |
a character value of length one
tbl_value <- "12.1 (95% CI: 9.1, 15.1)" ci_drop(tbl_value)#> [1] "12.1"ci_extract(tbl_value, drop_bracket = TRUE)#> [1] "95% CI: 9.1, 15.1"ci_lower_bound(tbl_value)#> [1] "9.1"ci_upper_bound(tbl_value)#> [1] "15.1"