zap: Zap small values in a clifford object

zapR Documentation

Zap small values in a clifford object

Description

Generic version of zapsmall()

Usage

zap(x, drop=TRUE, digits = getOption("digits"))

Arguments

x

Clifford object

drop

Boolean with default TRUE meaning to coerce the output to numeric with drop()

digits

number of digits to retain

Details

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.

Author(s)

Robin K. S. Hankin

Examples


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)

clifford documentation built on Aug. 14, 2022, 1:05 a.m.