Learn R Programming

MLZ (version 0.1.5)

bin_length: Bin length data

Description

A tool to bin raw length observations into a length frequency matrix.

Usage

bin_length(df, breaks = NULL)

Value

A list with length bins, years, and frequency matrix.

Arguments

df

A data frame or matrix of length observations. The first column should be named 'Year' and the second column should be named 'Length'.

breaks

An optional vector for breaks for hist.

Details

Length frequencies from Len_df are created by using hist function.

Examples

Run this code
if (FALSE) {
data(SilkSnapper)
Silk.matrix <- bin_length(SilkSnapper, breaks = seq(80, 830, 10))
Silk.matrix <- bin_length(SilkSnapper)
new.dataset <- new("MLZ_data", Year = Silk.matrix$Year, Len_bins = Silk.matrix$Len_bins,
Len_matrix = Silk.matrix$Len_matrix)
} 

Run the code above in your browser using DataLab