plot.ECGr {ECG} | R Documentation |
Plots an ECGr object
Description
Creates a plot for a series of replicated observations with the extrapolated center of gravity method.
Usage
## S3 method for class 'ECGr'
plot(x, add = TRUE, ...)
Arguments
x |
an ECGr object. |
add |
a logical value, if true then the plot is added to an existing one, otherwise it creates a new plot. |
... |
additional parameters. |
Details
It plots the sequence of approximations for each fraction of the dataset, and it shows the estimated value while extrapolated at zero fraction.
Value
No return value. Used for graphical display.
Author(s)
H. Gasca-Aragon
See Also
See Also as ECGr
, print.ECGr
Examples
require(ECG)
N<- 1000
set.seed(12345)
d1<- 1-sin(seq(1:(5/2*N))/N*pi-pi*3/4)+rnorm(5/2*N, 0, 0.01)
d2<- 1-sin(seq(1:(5/2*N))/N*pi-pi*3/4)+rnorm(5/2*N, 0, 0.01)
dat<- data.frame(x=1:length(d1),
y1=100*(d1-min(d1))/(max(d1)-min(d1)),
y2=100*(d2-min(d2))/(max(d2)-min(d2))
)
# used alone
ECGres<- ECGr(dat, columns=c(2,3))
plot(ECGres, add = FALSE)
# used in colaboration with CGr
CGres<- CGr(dat, columns=c(2,3))
# display the Center of Gravity approach for replicated observations
plot(CGres, verbose = TRUE)
# then add the extrapolation sequence
plot(ECGres)
[Package ECG version 0.5.2 Index]