m_filter: Data frame approximations of Murphy diagrams

Description Usage Arguments Details Value See Also

View source: R/utils.R

Description

Data frame approximations of Murphy diagrams

Usage

1
2
3
m_filter(m, window = range(m), resolution = 100)

m_approx(m, thresholds = 100)

Arguments

m

an object inheriting from class 'murphydiag'

window

a numeric vector of the form c(x1, x2, y1, y2); e.g., range(m) or par("usr")

resolution

a numeric vector of the form c(nx, ny) by which to divide window

thresholds

a numeric vector of values where interpolation is to take place; alternatively, a single number specifying the amount of equally spaced points spanning range(m, dim = "knots")

Details

The primary purpose of m_filter and m_approx is to reduce the amount of points in plot(m).

m_filter aims to retain discontinuities and a visual impression that is close to the true empirical Murphy diagram.

m_approx performs smooth linear interpolation between midpoints, evaluated at given threshold values on the x-axis.

This is achieved by two different methods:

m_filter moves sequentially through the rows of as.data.frame(m). Any point with a value close to 0 on the y-axis is retained. Otherwise, a rectangle with dimensions c(x2 - x1, y2 - y1) / c(nx, ny) is placed, with the latest retained point at its center. The next point that falls outside of this rectangle (and that point's predecessor) are then retained, and any points inbetween are discarded.

m_approx performs a linear approximation on the data set of the knots and the midpoints of left-sided and right-sided limits of the Murphy diagram values in the respective knots. Afterwards that approximation is evaluated at user-specified thresholds or at a user-specified number of equally spaced points spanning range(m, dim = "knots").

Value

m_filter returns a data.frame with four columns: name, knot, limit, value. The returned data.frame comprises a subset of the rows returned by as.data.frame(m).

m_approx returns a data.frame with three columns: name, threshold, value

See Also

For an exact data.frame representation see as.data.frame.murphydiag.

range.murphydiag


aijordan/murphydiagram2 documentation built on Jan. 1, 2020, 3:08 p.m.