Learn R Programming

halk (version 0.0.5)

bin_lengths: Convert a vector of lengths into binned values

Description

This will take a vector of numeric values and bin them according to the value specified in binwidth

Usage

bin_lengths(x, binwidth, include_upper = FALSE, ...)

Value

A vector of values the same length as x, but binned to the values according to binwidth

Arguments

x

Numeric vector of values

binwidth

Numeric vector specifying how wide the length bins should be

include_upper

Logical. Append the upper value of the bin and return the length range as a character string (TRUE), or return the lower value as numeric (FALSE, default)

...

Additional arguments passed onto cut

Examples

Run this code
bin_lengths(length_data$length, binwidth = 2)

Run the code above in your browser using DataLab