Convert a Mashed Table to a data.table or data.frame
# S3 method for Mashed_table
as.data.table(
x,
keep.rownames = NULL,
...,
mash_method = attr(x, "mash_method"),
insert_blank_row = attr(x, "insert_blank_row"),
id_vars = attr(x, "id_vars"),
suffixes = names(x)
)# S3 method for Mashed_table
as.data.frame(
x,
row.names = NULL,
optional = FALSE,
...,
mash_method = attr(x, "mash_method"),
insert_blank_row = attr(x, "insert_blank_row"),
id_vars = attr(x, "id_vars"),
suffixes = names(x)
)
a data.table or data.frame
a Mashed_table
ignored
passed on to as.data.table()
or as.data.frame()
respectively
either "row"
or "col"
. Should the tables be mashed
together with alternating rows or with alternating columns?
Only if mashing rows: logical. Whether to insert blank rows between mash-groups. Warning: this converts all columns to character. Use with care.
Only if mashing columns: one ore more colnames of the tables
to be mashed. If supplied, columns of both input tables are combined with
merge()
, otherwise cbind()
is used.
a character vector of length 2 specifying the suffixes to be used for making unique the names of columns.
ignored
logical. If TRUE
, setting row names and
converting column names (to syntactic names: see
make.names
) is optional. Note that all of R's
base package as.data.frame()
methods use
optional
only for column names treatment, basically with the
meaning of data.frame(*, check.names = !optional)
.
See also the make.names
argument of the matrix
method.