Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

setColNames.DTSg

Set Names of Value Columns


Description

Set the names of columns of DTSg objects.

Usage

## S3 method for class 'DTSg'
setColNames(
  x,
  cols = self$cols(class = "numeric")[1L],
  values,
  clone = getOption("DTSgClone"),
  ...
)

Arguments

x

A DTSg object (S3 method only).

cols

A character vector specifying the columns whose names shall be set. The name of the .dateTime column cannot be set.

values

A character vector of the same length as cols specifying the desired names.

clone

A logical specifying if the object is modified in place or if a clone (copy) is 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")

## S3 method
setColNames(x = x, cols = "flow", values = "River Flow")

DTSg

A Class for Working with Time Series Based on 'data.table' and 'R6' with Largely Optional Reference Semantics

v0.7.0
MIT + file LICENSE
Authors
Gerold Hepp [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.