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

poly2str

Print Polynomial


Description

Print polynomial as a character string.

Usage

poly2str(p, svar = "x", smul = "*", d = options("digits")$digits)

Arguments

p

numeric vector representing a polynomial

svar

character representing the unknown, default x.

smul

multiplication symbol, default *.

d

significant digits, default options("digits").

Details

Simple string manipulation.

Value

Returns the usual string representing a polynomial in mathematics.

Examples

poly2str(c(0))
poly2str(c(1, -1, 1, -1, 1))
poly2str(c(0, 1e-6, 1e6), d = 2)

pracma

Practical Numerical Math Functions

v2.3.3
GPL (>= 3)
Authors
Hans W. Borchers [aut, cre]
Initial release
2021-01-22

We don't support your browser anymore

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