
Last chance! 50% off unlimited learning
Sale ends in
Reshape CI between wide/long formats.
reshape_ci(x, ci_type = "CI")
A data frame with columns corresponding to confidence intervals reshaped either to wide or long format.
A data frame containing columns named CI_low
and CI_high
(or
similar, see ci_type
).
String indicating the "type" (i.e. prefix) of the interval
columns. Per easystats convention, confidence or credible intervals are
named CI_low
and CI_high
, and the related ci_type
would be "CI"
.
If column names for other intervals differ, ci_type
can be used to
indicate the name, e.g. ci_type = "SI"
can be used for support intervals,
where the column names in the data frame would be SI_low
and SI_high
.
x <- data.frame(
Parameter = c("Term 1", "Term 2", "Term 1", "Term 2"),
CI = c(.8, .8, .9, .9),
CI_low = c(.2, .3, .1, .15),
CI_high = c(.5, .6, .8, .85),
stringsAsFactors = FALSE
)
reshape_ci(x)
reshape_ci(reshape_ci(x))
Run the code above in your browser using DataLab