Learn R Programming

DTSg (version 2.0.0)

merge.DTSg: Merge two objects

Description

Joins two DTSg objects based on their .dateTime column. Their time zones and aggregated fields must match.

Usage

# S3 method for DTSg
merge(x, y, ..., clone = getOption("DTSgClone"))

Value

Returns a DTSg object.

Arguments

x

A DTSg object (S3 method only).

y

A DTSg object or an object coercible to one. See new for further information.

...

Further arguments passed on to data.table::merge. As the by, by.x and by.y arguments can endanger the object's integrity, they are rejected.

clone

A logical specifying if the object shall be modified in place or if a deep clone (copy) shall be made beforehand.

See Also

Examples

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

# merge with 'data.table'
## R6 method
x$merge(
  y = flow,
  suffixes = c("_1", "_2")
)$print()

## S3 method
print(merge(
  x = x,
  y = flow,
  suffixes = c("_1", "_2")
))

Run the code above in your browser using DataLab