bin_vector: Bin vectors

View source: R/compute_bin.R

bin_vectorR Documentation

Bin vectors

Description

A generic and several implementations for binning vectors.

Usage

bin_vector(x, weight = NULL, ...)

## S3 method for class 'numeric'
bin_vector(
  x,
  weight = NULL,
  ...,
  width = 1,
  origin = 0,
  closed = c("right", "left"),
  pad = FALSE
)

Arguments

x

A vector to bin

weight

If specified, an integer vector of the same length as x representing the number of occurances of each value in x

...

additional arguments passed through to methods.

width

The width of a bin

origin

The left-most value for bins.

closed

One of "right" or "left" indicating whether right or left edges of bins are included in the bin.

pad

A logical indicating whether the bins should be padded to include an empty bin on each side.


ggvis documentation built on May 29, 2024, 1:12 a.m.