setColNames.DTSg {DTSg} | R Documentation |
Set column names
Description
Changes the column names of DTSg
objects.
Usage
## S3 method for class 'DTSg'
setColNames(
x,
cols = self$cols(class = "numeric")[1L],
values,
clone = getOption("DTSgClone"),
...
)
Arguments
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). |
Value
Returns a DTSg
object.
See Also
Examples
# 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"
))
[Package DTSg version 1.1.3 Index]