Re {onion} | R Documentation |
Get or set each component of an onionic vector
## S3 method for class 'octonion' Re(z) ## S3 method for class 'octonion' Im(z) ## S3 method for class 'octonion' i(x) ## S3 method for class 'octonion' j(x) ## S3 method for class 'octonion' k(x) ## S3 method for class 'octonion' l(x) ## S3 method for class 'octonion' il(x) ## S3 method for class 'octonion' jl(x) ## S3 method for class 'octonion' kl(x) ## S3 replacement method for class 'octonion' Re(x) <- value ## S3 replacement method for class 'octonion' Im(x) <- value ## S3 replacement method for class 'octonion' i(x) <- value ## S3 replacement method for class 'octonion' j(x) <- value ## S3 replacement method for class 'octonion' k(x) <- value ## S3 replacement method for class 'octonion' l(x) <- value ## S3 replacement method for class 'octonion' il(x) <- value ## S3 replacement method for class 'octonion' jl(x) <- value ## S3 replacement method for class 'octonion' kl(x) <- value ## S3 method for class 'quaternion' Re(z) ## S3 method for class 'quaternion' Im(z) ## S3 method for class 'quaternion' i(x) ## S3 method for class 'quaternion' j(x) ## S3 method for class 'quaternion' k(x) ## S3 replacement method for class 'quaternion' Re(x) <- value ## S3 replacement method for class 'quaternion' Im(x) <- value ## S3 replacement method for class 'quaternion' i(x) <- value ## S3 replacement method for class 'quaternion' j(x) <- value ## S3 replacement method for class 'quaternion' k(x) <- value ## S3 method for class 'onion' get.comp(x,i) ## S3 replacement method for class 'onion' set.comp(x,i) <- value
x,z |
An onionic vector |
value |
A real vector (or, in the case of |
i |
In functions |
All return an onion of the appropriate class.
In the case of Im<-
methods, if value
has the special
value 0
, then all the imaginary parts will be set to zero, as
though one had typed Im(a) <- Im(a)*0
. Note that setting value
to rep(0,length(x))
will not work; neither will
Im(x) <- 3
(say).
These functions are all specific to their algebra; there is no onionic generalization. This is because the code is more structured. It also makes it easier to change the names of the bases.
Functions get.comp()
and the various methods for
set.comp<-()
are not really intended for the end-user. It is
better to use idioms such as il(x)
and i(x) <- 4
Robin K. S. Hankin
x <- octonion(Re=1,il=1:3,j=3:1) Re(x) kl(x) <- 1000