cbrob: Combine Brobdingnagian vectors

Description Usage Arguments Details Note Author(s) Examples

Description

Combine Brobdingnagian or Glubdubbdribian vectors through concatenation

Usage

1
cbrob(x, ...)

Arguments

x

Brobdingnagian vector

...

Other arguments coerced to brob form

Details

If any argument has class glub, all arguments are coerced to glubs. Otherwise, if any argument has class brob, all arguments are coerced to brobs.

Function cbrob() operates recursively, calling .cPair() repeatedly. Function .cPair() uses S4 method dispatch to call either .Brob.cpair() or .Glub.cpair() according to the classes of the arguments.

Note

As of R-2.4.0, it is apparently not possible to use S4 methods to redefine c() to coerce to class brob form and concatenate as expected. This would seem to be a reasonable interpretation of c() from the user's perspective.

Conceptually, the operation is simple: concatenate the value slot and the positive slot separately, then call brob() on the two resulting vectors. When concatenating glub objects, the real and imaginary components (being brobs) are concatenated using .Brob.cpair()

The choice of name—cbrob()—is not entirely logical. Because it operates consistently on brob and glub objects, it might be argued that cSwift() would be a more appropriate name.

Author(s)

Robin K. S. Hankin; original idea due to John Chambers

Examples

1
2
3
a <- as.brob(2)^1e-40
cbrob(1:4,4:1,a)
cbrob(1:4,a,1i)

Brobdingnag documentation built on May 2, 2019, 8:46 a.m.