
Last chance! 50% off unlimited learning
Sale ends in
Convert raw length measurements to length frequency data (lfq class).
lfqCreate(
data,
Lname,
Dname,
Fname = NA,
bin_size = 1,
species = NA,
stock = NA,
comment = "",
Lmin = 0,
length_unit = "cm",
plus_group = FALSE,
aggregate_dates = FALSE,
plot = FALSE
)
A list of "lfq" class with
dates dates of sampling times (class Date),
midLengths midpoints of the length classes,
catch matrix with catches/counts per length class (row) and sampling date (column).
data with at least two columns, one with the length measurements, one with the sampling date
name of the length column
name of the date column
optional; name of column with frequency, in case each length was measured more than one time
size of the bins in cm (Default: 2)
character; to store species name in lfq list
character; to store stock ID or name in lfq list
optional character; to store comments conerning the lfq list
minimum length for the midLengths vector (default: 0)
unit of length measurements, either "cm" (default), "mm" or "m"
logical; should a plus group be created? If yes you will be asked to insert the length for the plus group in the console (default: FALSE). Instead of inserting the length of the plus group via the console, the value can be incorporated in a vector, e.g. plus_group = c(TRUE, 30).
logical; indicating whether dates should be lumped in monthly sampling times (assuming sampling always aound the 15th of each month; default is FALSE). More exact lumping can only done manually and then sampling dates provided in data.
logical; should a graph of lfq data be displayed? (Default: FALSE)
# create random data
set.seed(1)
data <- data.frame(length.mm. = sample(c(rpois(300, lambda = 60),
rpois(200, lambda = 100), rpois(100, lambda = 150)),
size = 1000, replace = TRUE),
dates = seq.Date(as.Date("2015-10-02"),as.Date("2016-08-28"),
length.out = 1000))
# create lfq data
lfq_dat <- lfqCreate(data,Lname = "length.mm.", Dname = "dates", aggregate_dates = TRUE,
length_unit = "mm", bin_size = 0.5, plot=TRUE, plus_group=c(TRUE,15.75))
Run the code above in your browser using DataLab