xcast | R Documentation |
xnew_data()
Casts a sequence of values to the same class as the original vector.
xcast(..., .data = xnew_data_env$data)
... |
TBD |
.data |
Normally defined by |
xnew_seq()
is a wrapper function on vctrs::vec_cast()
for use in xnew_data()
to avoid
having to repeating the column name.
vctrs::vec_cast()
and xnew_data()
data <- tibble::tibble(
period = factor(c("before", "before", "after", "after"),
levels = c("before", "after")
),
annual = factor(c(1, 3, 5, 8), levels = c(1, 3, 5, 8))
)
xnew_data(data, xcast(period = "before"))
xnew_data(data, xcast(period = "before", annual = c("1", "3")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.