ys_rename | R Documentation |
What gets renamed depends on the first argument: either yspec
object
or data.frame
. When renaming yspec
object, use new = old
syntax. When
renaming columns in data.frame
, pass old names only in tidy select syntax;
the new names come from calls to ys_get_short()
or ys_get_short_unit()
.
ys_rename(.x, ...)
## S3 method for class 'yspec'
ys_rename(.x, ...)
## S3 method for class 'data.frame'
ys_rename(.x, .spec, ..., .title_case = TRUE, .short_max = Inf, .unit = FALSE)
.x |
A |
... |
For the |
.spec |
A |
.title_case |
Passed to |
.short_max |
Passed to |
.unit |
Logical indicating if the unit should be appended to the short rename value. |
A yspec
object or data.frame
with renamed columns, depending on what was
passed as .x
.
ys_join()
, ys_filter()
, ys_select()
spec <- ys_help$spec()
ans <- ys_rename(spec, TIME = TAFD, RENAL = RF)
tail(ans)
data <- ys_help$data()
ys_rename(data, spec, AGE:HT)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.