as.data.frame.DATRASraw {DATRAS}R Documentation

Convert DATRASraw to data.frame suitable for statistical analysis.

Description

Method to convert DATRASraw to data.frame with one line for each response.

Usage

  ## S3 method for class 'DATRASraw'
 as.data.frame(x, ...,
    format = c("long", "wide"), response, cleanup = TRUE)

Arguments

x

DATRASraw object to be converted.

format

Long or wide format?

response

Name of response variable (only needed if data has multiple response variables).

cleanup

Remove useless information?

...

Not used.

Details

This function should be called as the final step after preprocessing ( subset(), addSpectrum(), addNage(), etc ). The output format can be controlled by the argument format. If format="long" the data.frame has one line for each response which is the standard for most statistical procedures. In the less usual case format="wide" the data.frame has one line for each haul (sample id) with multiple responses across the columns of the response matrix. The wide format thus takes up less memory. If multiple response names are available in x (e.g. both "N" and "Nage") then the user must select one through the argument response.

Value

data.frame with one line for each response along with associated covariates.


[Package DATRAS version 1.0 Index]