Re {onion} | R Documentation |
Get or set each component of an onionic vector
## S3 method for class 'octonion': Re(x) ## S3 method for class 'octonion': Im(x) ## 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 method for class 'octonion': Re(x) <- value ## S3 method for class 'octonion': Im(x) <- value ## S3 method for class 'octonion': i(x) <- value ## S3 method for class 'octonion': j(x) <- value ## S3 method for class 'octonion': k(x) <- value ## S3 method for class 'octonion': l(x) <- value ## S3 method for class 'octonion': il(x) <- value ## S3 method for class 'octonion': jl(x) <- value ## S3 method for class 'octonion': kl(x) <- value ## S3 method for class 'quaternion': Re(x) ## S3 method for class 'quaternion': Im(x) ## S3 method for class 'quaternion': i(x) ## S3 method for class 'quaternion': j(x) ## S3 method for class 'quaternion': k(x) ## S3 method for class 'quaternion': Re(x) <- value ## S3 method for class 'quaternion': Im(x) <- value ## S3 method for class 'quaternion': i(x) <- value ## S3 method for class 'quaternion': j(x) <- value ## S3 method for class 'quaternion': k(x) <- value give.comp(x,i) ## S3 method for class 'onion': set.comp(x,i) <- value
x |
An onionic vector |
value |
A real vector (or, in the case of Im<-() and
set.comp<-() , an appropriately sized matrix) |
i |
Integer between 1 and 2^n where n depends on the type of onion |
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.
Robin K. S. Hankin
x <- octonion(Re=1,il=1:3,j=3:1) Re(x) kl(x) <- 1000