diff.drift: Differentiate or smooth DRIFT-spectrum

Description Usage Arguments Value See Also Examples

View source: R/drift_diff.R

Description

Differentiate or smooth DRIFT-spectrum using spline fit model. This is an S3-method for class drift.

Usage

1
2
## S3 method for class 'drift'
diff(x, n = 1L, ...)

Arguments

x

an object of S3-class drift.

n

integer order of derivative. First order derivative is the default value. Assign zero to perform smoothing which is the zero-order derivative.

...

other named parameters to smooth.spline including but not limited to

spar

smoothing parameter in (0,1] range. Default value 0.8 usualy is rather good value for DRIFT-spectra of hard coals

df

the desired equivalent number of degrees of freedom. Default value 12 usualy is rather good value for DRIFT-spectra of hard coals.

Value

An object of S3-class drift.

See Also

Other drift: as.data.frame.drift(), cbind.drift(), channel(), coal_drift(), median.drift(), plot.drift(), read.drift(), slice(), write.drift()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
 s <- coal_drift()

 # first derivative:
 ds <- diff(s)
 plot(ds)

 # simple smoothing of signal:
 ss <- diff(s, 0)
 plot(ss)

 # second derivative:
 d2s <- diff(s, n = 2)
 plot(d2s)

 # sequential application of differentiation is not equivalent to higher
 # order differentiation in place:
 range(diff(diff(s)) - diff(s, 2))

omega1x/spectrotest documentation built on Oct. 1, 2020, 4 p.m.