Set Values of Columns
Set the values of columns, add columns to and/or remove columns from a
DTSg
object. The values can optionally be set for certain rows
only.
## S3 method for class 'DTSg' setCols( x, i, cols = self$cols(class = "numeric")[1L], values, clone = getOption("DTSgClone"), ... )
x |
A |
i |
An integerish vector indexing rows (positive numbers pick and
negative numbers omit rows) or a filter expression accepted by the |
cols |
A character vector specifying the columns whose values shall be set. The values of the .dateTime column cannot be set. |
values |
A vector, |
clone |
A logical specifying if the object is modified in place or if a clone (copy) is made beforehand. |
... |
Not used (S3 method only). |
Returns a DTSg
object.
# new DTSg object x <- DTSg$new(values = flow) # cap river flows to 100 ## R6 method x$setCols(i = flow > 100, cols = "flow", values = 100) ## S3 method setCols(x = x, i = flow > 100, cols = "flow", values = 100)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.