Learn R Programming

mizer (version 3.0.0)

as.data.frame: Convert mizer arrays to data frames

Description

The as.data.frame() methods for mizer array classes turn matrix- and array-like results into tidy long-form data frames, with one row per observed combination of species, size and/or time. The numeric result is always stored in a column called value.

Value

A data frame in long format.

Arguments

x

An ArraySpeciesBySize, ArrayTimeBySpecies or ArrayTimeBySpeciesBySize object.

row.names

Optional and included only for compatibility with the base generic. NULL or a character vector giving the row names for the data frame.

optional

Optional and included only for compatibility with the base generic. A logical value. If TRUE, setting row names and converting column names (to syntactic names) is optional.

...

Further arguments. They are currently ignored by the mizer methods.

Details

The returned columns are:

  • ArraySpeciesBySize: w, value, Species.

  • ArrayTimeBySpecies: time, value, Species.

  • ArrayTimeBySpeciesBySize: time, Species, w, value.

If the original object has non-numeric or missing dimension names, sequential indices are used for the time or w columns. Species names are taken from the row, column or dimension names of the original object.

See Also

print(), summary(), plot(), ArraySpeciesBySize(), ArrayTimeBySpecies(), ArrayTimeBySpeciesBySize()

Examples

Run this code
# \donttest{
enc <- getEncounter(NS_params)
head(as.data.frame(enc))

biomass <- getBiomass(NS_sim)
head(as.data.frame(biomass))
# }

Run the code above in your browser using DataLab