Converts the size coordinate of the plotting data to the requested axis and,
when the values are a density, multiplies them by the Jacobian that restates
them in the density measure that axis calls for (see
density_target_measure()). Values that are not a density are left alone.
convert_plot_density_axis(
plot_dat,
params,
size_axis,
density_wrt = NA_character_,
per_log_size = NULL,
species_col = "Species",
value_col = 2
)The plotting data with its size coordinate, and where called for its values, expressed for the requested axis. The size coordinate is the first column.
A data frame of plotting data with a w column and a species
column.
A MizerParams object providing the weight-length parameters.
Either "w" (weight) or "l" (length).
The measure the values are a density with respect to, see
density_measures. NA (the default) means the values are not a density.
Whether to express the values per logarithmic size.
NULL (the default) keeps whichever the values already are.
Name of the column identifying the species. Default is
"Species".
Name or index of the value column. Defaults to the second column.
Anything involving a length is a per-species quantity, because the weight-length relationship is, so rows whose species is not one of the model's species — the "Total" row, for instance — are dropped when a length is needed. Going from a density per size to one per logarithmic size needs no length, and keeps those rows.