View source: R/pstructure.v4.r
| as.data.frame.pstructure | R Documentation |
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.
## S3 method for class 'pstructure'
as.data.frame(x, row.names = NULL, optional = FALSE, ...,
omit.marginality = FALSE)
x |
The |
row.names |
NULL or a |
optional |
A
|
... |
Further arguments passed to or from other methods. |
omit.marginality |
A |
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.
Chris Brien
as.data.frame.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.