| cbrob | R Documentation |
Combine Brobdingnagian or Glubdubbdribian vectors through concatenation
cbrob(x, ...)
x |
Brobdingnagian vector |
... |
Other arguments coerced to brob form |
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.
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.
Robin K. S. Hankin; original idea due to John Chambers
a <- as.brob(2)^1e-40 cbrob(1:4,4:1,a) cbrob(1:4,a,1i)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.