cutNumeric: Cut numeric data into bins with vector output

View source: R/cutNumeric.R

cutNumericR Documentation

Cut numeric data into bins with vector output

Description

This function cuts a vector of numbers just like the base R function cut except that the output will be a vector of numbers rather than that weird factor that's the default. The number listed in the output will be the upper boundary of the bin for the number that was used in the input.

Usage

cutNumeric(x, breaks)

Arguments

x

A numeric string

breaks

the desired breaks in that string; these are the same as for the base function "cut". The number must be <= the bin into which it is sorted and the number must be >= the next-lower bin.

Value

Returns a vector of numeric data

Examples


cutNumeric(c(-5, 17, 32, 65, 118), breaks = c(c(0, 15, 30, 60, 120)))



shirewoman2/LaurasHelpers documentation built on Oct. 22, 2023, 2:07 p.m.