setColNames.DTSg | R Documentation |
Changes the column names of DTSg
objects.
## S3 method for class 'DTSg'
setColNames(
x,
cols = self$cols(class = "numeric")[1L],
values,
clone = getOption("DTSgClone"),
...
)
x |
A |
cols |
A character vector specifying the columns whose names shall be
set. Another possibility is a character string containing either comma
separated column names, for example, |
values |
A character vector of the same length as |
clone |
A logical specifying if the object shall be modified in place or if a deep clone (copy) shall be made beforehand. |
... |
Not used (S3 method only). |
Returns a DTSg
object.
cols
, getOption
# new DTSg object
x <- DTSg$new(values = flow)
# rename column "flow" to "River Flow"
## R6 method
x$setColNames(
cols = "flow",
values = "River Flow"
)$print()
## 'setnames()' is a "hidden" R6 alias for 'setColNames()'
x$setnames(
cols = "flow",
values = "River Flow"
)$print()
## S3 method
print(setColNames(
x = x,
cols = "flow",
values = "River Flow"
))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.