Learn R Programming

PolynomF (version 1.0-2)

as.character.polynom: Coerce polynomial object to character

Description

Coerces a polynom object to a printable character representation.

Usage

# S3 method for polynom
as.character(x, variable = "x", decreasing = FALSE, …)

Arguments

x

A polynom object

variable

Character string with the desired variable name.

decreasing

Should the powers be decreasing, or increasing as in power series form?

Not presently used

Value

A character string.

Details

The character string may be parsed into an expression for the polynomial itself.

References

None

Examples

Run this code
# NOT RUN {
p <- poly.from.zeros(-2:4)
as.character(p)
# "48*x - 28*x^2 - 56*x^3 + 35*x^4 + 7*x^5 - 7*x^6 + x^7"

# }

Run the code above in your browser using DataLab