CGdata {ECG}R Documentation

Creates a CGdata object

Description

Builds a CGdata (center of gravity) object for a series of single observations.

Usage

CGdata(data, from=min(data$x), to=max(data$x), responseFraction = 0.5, 
	useConstantDelta = FALSE, fixedResponseFraction = 0.5, 
	useFixedResponseFraction = FALSE, replaceOutliers = TRUE, 
	responseLowerLimit = min(data$y), responseUpperLimit = max(data$y),
	alpha = 0.05, signifDigits = 2, ...)

Arguments

data

a data frame structure containing (x, y) columns.

from

a numeric value with the initial value of x to search for a local minimum.

to

a numeric value with the final value of x to search for a local minimum.

responseFraction

a real value with the fraction (0,1) of the maximum height to be considered in the analysis.

useConstantDelta

a logic value, if true then it assumes the values of x increments at constant rate, otherwise it computes each increment.

fixedResponseFraction

a numeric with the fraction of height to be used as a reference to normilize, default value is 0.5.

useFixedResponseFraction

a logic value, if TRUE then it uses the value of fixedResponseFraction to normalize all the computations, otherwise it uses the value of responseFraction to normalize, default value is TRUE.

replaceOutliers

a logic value, if true then it uses the value of responseLowerLimit and responseUpperLimit to replace outlier values. Default value is TRUE.

responseLowerLimit

a real value to be used as the default to replace outlier values lower than expected.

responseUpperLimit

a real value to be used as the default to replace outlier values larger than expected.

alpha

a real value, it defines the level of error type I used to estimate the coverage factor kp and the expanded uncertainty, its default value is 0.05.

signifDigits

an integer value, it defines the number of significant digits to be used for displaying the result and its uncertainty, default value is 2.

...

additional parameters.

Value

x

numeric, the estimated value

u

numeric, the estimated uncertainty associated to x

moments

numeric vector, the estimated mean, variance, skweness and kurtosis

input

list, contains the input parameters

frame

list, contains the reference values of the analysis. This information is used to build a verbosed version of its plot. The content of the list is: y.x.band.min the local maximum found in the lower region of the analysis region.
y.x.band.max the local maximum found it the upper region of the analysis region.
x.min.y the value of x where the local minumum y occurrs.
x.max the value of x where the local maximum y.x.max occurs.
x.min the value of x where the locel maximum y.x.min occurs.
y.x.max the maximum height in the upper region of the analysis.
y.x.min the maximum height in the lower region of the analysis.
h the value of the index of x associated with f.i fraction of the data in the lower region of analysis.
k the value of the index of x associated with f.i fraction of the data in the upper region of analysis.
x.h the value of x associated with f.i fraction of the data in the lower region of analysis.
x.k the value of x associated with f.i fraction of the data in the upper region of analysis.

used.data.points the number of datapoints of x used to obtain the estimates, this is equal to k-h+1.

Author(s)

H. Gasca-Aragon

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)
dat<- data.frame(x=1:length(d1), 
	y=100*(d1-min(d1))/(max(d1)-min(d1)))

CGres <- CGdata(dat)
CGres

[Package ECG version 0.5.2 Index]