zap {clifford} | R Documentation |
Generic version of zapsmall()
zap(x, drop=TRUE, digits = getOption("digits"))
x |
Clifford object |
drop |
Boolean with default |
digits |
number of digits to retain |
Given a clifford object, coefficients close to zero are
‘zapped’, i.e., replaced by ‘0’ in much the same way as
base::zapsmall()
.
The function should be called zapsmall()
, and dispatch to the
appropriate base function, but I could not figure out how to do this
with S3 (the docs were singularly unhelpful) and gave up.
Note, this function actually changes the numeric value, it is not just a print method.
Robin K. S. Hankin
a <- clifford(sapply(1:10,seq_len),90^-(1:10))
zap(a)
options(digits=3)
zap(a)
a-zap(a) # nonzero
B <- rblade(g=3)
mB <- B*rev(B)
zap(mB)
drop(mB)