Skip to contents

Convert a datras_raw / DATRASraw object to either long or wide tabular format.

Usage

as_table(x, type = "long", ...)

Arguments

x

A datras_raw object.

type

Character string specifying the output format. Must be either "long" (default) or "wide".

...

Additional arguments passed to as_long_format() or as_wide_format().

Value

A data frame in the requested format.

Details

This is a convenience wrapper around as_long_format() and as_wide_format().

If type = "long", the object is converted using as_long_format(). If type = "wide", the object is converted using as_wide_format().

Examples

if (FALSE) { # \dontrun{
## Long-format table
tab_long <- as_table(x, type = "long")

## Wide-format table
tab_wide <- as_table(x, type = "wide")
} # }