Learn R Programming

kzfs (version 1.5.0.2)

a2d: Internal Functions For kzpdr, kzp2, kz.ft, and kzrc2

Description

A group of internal functions used by kzpdr, kzp2, kz.ft, and kzrc2.

  • a2d transfers 2D array to data frame. If input is data frame, it will return the original data frame.

  • agrid aggregates data based on given grid scale.

  • best.cor returns the largest correlation and related lags on x- or y-direction for two image matrices.

  • df2mt transfers data frame to matrix.

  • efg gives projected wave frequency on given direction.

  • getwave is designed to extract data series along a given direction in a 2D field.

  • getwavf extracts data series along a given direction in a 2D field with phase arranged according to the wave frequency.

  • markspikes and spikes.2d are functions to mark the spikes of the 1D periodogram and 2D periodogram, respectively.

Usage

a2d(a)

agrid(df, scale, math = "mean")

best.cor(rc, sig, ...)

df2mt(df, scale)

efg(f, d, ag)

getwave(df, angle, cp = 0)

getwavf(df, angle, f1, rlvl = 1)

spikes.2d(x.fq, y.spm, nm = 10)

markspikes(x.fq, y.spm, plot = TRUE, ...)

Arguments

a

2D array for position and signal values.

df

Data frame of signal values and positions.

scale

Vector for scale of each dimension. For example, for a x * y grid, the scale is c(1/x, 1/y).

math

Function to aggregate the data. Defaults to "mean".

rc

Array. Reconstructed signal.

sig

Array. Original signal (without noise).

...

Other arguments, i.e. the "cut" threshold, etc.

  • cut : Set the minimum value for a marked frequency spike. Recommend to use argument lvl instead of setting this value directly.

  • lvl : "min" or "max". Threshold strategy for marking frequency spikes. Essentially it will set the "cut" threshold value as different level. "min" is used for cases of weak singles dominating by some strong singles. Defaults to "max".

f

Wave frequency.

d

Wave direction.

ag

Sampling direction.

angle

Direction or vector of directions in radians.

cp

Sampling scheme. Values 0, 2, and others : normal; 1: interpolation; 3: errors

f1

Wave frequency

rlvl

Coefficient to control the averaging level.

x.fq

Vector of frequency values for x axis.

y.spm

Vector of spectrum values for y axis.

plot

If need to add marks on the periodogram. Defaults to TRUE.

angle

Wave direction