Last data update: 2014.03.03

R: Coerce polynomial object to character
as.character.polynomR Documentation

Coerce polynomial object to character

Description

Coerces a polynom object to a printable character representation.

Usage

## S3 method for class '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

Details

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

Value

A character string.

Author(s)

Bill Venables, with contributions from Kurt Hornik

References

None

Examples

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"

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(PolynomF)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/PolynomF/as.character.polynom.Rd_%03d_medium.png", width=480, height=480)
> ### Name: as.character.polynom
> ### Title: Coerce polynomial object to character
> ### Aliases: as.character.polynom
> ### Keywords: symbolmath
> 
> ### ** Examples
> 
> p <- poly.from.zeros(-2:4)
> as.character(p)
[1] "48*x - 28*x^2 - 56*x^3 + 35*x^4 + 7*x^5 - 7*x^6 + x^7"
> # "48*x - 28*x^2 - 56*x^3 + 35*x^4 + 7*x^5 - 7*x^6 + x^7"
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>