poly2str {control} | R Documentation |
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
Modified from package *pracma*. Modification: To hide any coefficient and power that is equal to 1 So that instead of '1s^3' we have 's^3' and instead of 's^1', we have 's'
Value
Returns the usual string representing a polynomial in mathematics.
Examples
poly2str(c(2, -3, 1, 20, -11))
[Package control version 0.2.5 Index]