Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

zap

Remove minuscule coefficients


Description

A convenience function for setting polynomial coefficients likely to be entirely round-off error to zero. The decision is relegated to the function base::zapsmall, to which this is a front-end.

Usage

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

## Default S3 method:
zap(x, digits = getOption("digits"))

## S3 method for class 'polynom'
zap(x, digits = getOption("digits"))

## S3 method for class 'polylist'
zap(x, digits = getOption("digits"))

## S3 method for class 'list'
zap(x, digits = getOption("digits"))

Arguments

x

A polynomial or polylist object

digits

As for base::zapsmall

Value

A polynomial or polylist object with minuscule coefficients set to zero.

Examples

(P <- poly_orth(-2:2, norm = FALSE))
zap(35*P)

PolynomF

Polynomials in R

v2.0-3
GPL-2
Authors
Bill Venables, with contribution by Kurt Hornik and Georgi Boshnakov
Initial release
2020-02-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.