fillet: Chop data precisely (for programmers)

filletR Documentation

Chop data precisely (for programmers)

Description

fillet() calls chop() with extend = FALSE and drop = FALSE. This ensures that you get only the breaks and labels you ask for. When programming, consider using fillet() instead of chop().

Usage

fillet(
  x,
  breaks,
  labels = lbl_intervals(),
  left = TRUE,
  close_end = TRUE,
  raw = NULL
)

Arguments

x

A vector.

breaks

A numeric vector of cut-points or a function to create cut-points from x.

labels

A character vector of labels or a function to create labels.

left

Logical. Left-closed or right-closed breaks?

close_end

Logical. Close last break at right? (If left is FALSE, close first break at left?)

raw

Logical. Use raw values in labels?

Value

fillet() returns a factor of the same length as x, representing the intervals containing the value of x.

See Also

Other chopping functions: chop_equally(), chop_evenly(), chop_fn(), chop_mean_sd(), chop_n(), chop_proportions(), chop_quantiles(), chop_width(), chop()

Examples

fillet(1:10, c(2, 5, 8))

santoku documentation built on Oct. 12, 2023, 5:13 p.m.