Last data update: 2014.03.03

R: Shift oritin
change.originR Documentation

Shift oritin

Description

These small convenience functions shift polynomials by relocating the origin to a new position. The primary function is generic and active methods are provided for polynom and polylist objects.

Usage

## Default S3 method:
change.origin(p, o, ...)
## S3 method for class 'polynom'
change.origin(p, o, ...)
## S3 method for class 'polylist'
change.origin(p, o, ...)

Arguments

p

A polynim or polylist object.

o

The value of the original variable to become the new origin, that is the zero value in the shifted variable.

...

Not used

Details

The function change.origin.default is a trap for unimplemeted methods.

Value

A polynom or polylist object with the origin shifted to 0.

Author(s)

Bill Venables

References

None

Examples

x <- polynom()
p <- 1 - 2*x + x^2
change.origin(p, 1)
## x^2

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/change.origin.Rd_%03d_medium.png", width=480, height=480)
> ### Name: change.origin
> ### Title: Shift oritin
> ### Aliases: change.origin change.origin.default change.origin.polynom
> ###   change.origin.polylist
> ### Keywords: symbolmath
> 
> ### ** Examples
> 
> x <- polynom()
> p <- 1 - 2*x + x^2
> change.origin(p, 1)
x^2 
> ## x^2
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>