interval_mid: Extract the midpoint of an interval assigned to a data frame.

Description Usage Arguments Value Author(s)

Description

interval_mid Calculates the mid-point of an interval to be used as an attractive label for plot axes when binning an axis. Intervals as defined by functions such as base-R cut.

Usage

1
interval_mid(x, dp = 1)

Arguments

x

A numeric vector or data frame column with intervals typically applied using the base-R cut function.

dp

A numeric scalar (default 1) defining the number of decimal places for the base-R round function. May be needed to ensure that mid-points are unique.

Value

A numeric vector containing the mid points of the intervals.

Author(s)

Alex M Trueman


truemoid/contactr documentation built on May 24, 2019, 9:58 p.m.