as.data.frame.pstructure {dae} | R Documentation |
Coerces a pstructure.object to a data.frame.
Description
Coerces a pstructure.object
, which is of class pstructure
,
to a data.frame
. One can choose whether or not to include the marginality
matrix in the data.frame. The aliasing
component is excluded.
Usage
## S3 method for class 'pstructure'
as.data.frame(x, row.names = NULL, optional = FALSE, ...,
omit.marginality = FALSE)
Arguments
x |
The |
row.names |
NULL or a |
optional |
A
|
... |
Further arguments passed to or from other methods. |
omit.marginality |
A |
Value
A data.frame
with as many rows as there are non-aliased terms
in the pstructure.object
. The columns are df
, terms
,
sources
and, if omit.marginality
is FALSE
, the columns of
the generated levels
with columns of the marginality
matrix
that is stored in the marginality
component of the object.
Author(s)
Chris Brien
See Also
Examples
## Generate a data.frame with 4 factors, each with three levels, in standard order
ABCD.lay <- fac.gen(list(A = 3, B = 3, C = 3, D = 3))
## create a pstructure object based on the formula ((A*B)/C)*D
ABCD.struct <- pstructure.formula(~ ((A*B)/C)*D, data =ABCD.lay)
## print the object either using the Method function or the generic function
ABCS.dat <- as.data.frame.pstructure(ABCD.struct)
as.data.frame(ABCD.struct)