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

values.DTSg

Get Values


Description

Queries the values of a DTSg object.

Usage

## S3 method for class 'DTSg'
values(
  x,
  reference = FALSE,
  drop = FALSE,
  class = c("data.table", "data.frame"),
  ...
)

Arguments

x

A DTSg object (S3 method only).

reference

A logical specifying if a copy of the values or a reference to the values is returned. See details for further information.

drop

A logical specifying if the object and all references to it shall be removed from the global (and only the global) environment after successfully querying its values. This feature allows for a resource efficient destruction of a DTSg object while preserving its values.

class

A character string specifying the class of the returned values. "data.frame" only works when either a copy of the values is returned or the object is dropped.

...

Not used (S3 method only).

Details

A reference to the values of a DTSg object can be used to modify them in place. This includes the .dateTime column which serves as the object's time index. Modifying this column can therefore endanger the object's integrity. In case needs to do so ever arise, refresh should be called immediately afterwards in order to check the object's integrity.

Value

Returns a data.table, a reference to a data.table or a data.frame.

Note

The original name of the .dateTime column is restored when not returned as a reference or when dropped.

See Also

Examples

# new DTSg object
x <- DTSg$new(values = flow)

# get values
## R6 method
x$values()

## S3 method
values(x = x)

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.