Calculus {Rsac} | R Documentation

## DIFFERENTIATION AND INTEGRATION

### Description

Differentiation (by two-point differencing) and integration (by rectangular approximation) in the time domain. For differentiation, the begining time of the time series is increased by half the sampling interval, and the length of the record is decreased by 1. It is also usually a good idea to use the `rtrend` or `rmean` function before integration.

### Usage

    dif(s)
    int(s)

### Arguments

`s` | an object of class `"rsac"`.

### Value

same as input.

### Author(s)

Eric M. Thompson <eric.thompson@tufts.edu>

### See Also

`rtrend`

### Examples

    data(srosa)
    getunits(srosa)
    # convert to cm/s/s
    srosa.accel <- dif(mul(srosa, 1e-7))

    amax <-  function(X)
      X$x <- max(abs(X$amp))

    pga <- max(sapply(X = srosa.accel, amax))
    # cm/s/s

    spect(srosa)

    srosa.disp <- int(rtrend(srosa))

    plot(srosa, xlim = c(100, 400))
    plot(srosa.disp, xlim = c(100, 400))
    srosa.disp <- hp(srosa.disp, c = 0.1)
    plot(srosa.disp, xlim = c(100, 400))
    spect(srosa.disp)

[Package Rsac version 0.1-8 Index]