| as.data.frame.dust {pixiedust} | R Documentation |
Convert dust Object to Data Frame
Description
Sprinkles are applied to the dust object
as if it were being prepared for printing to the console.
However, instead of printing, the object is returned
as a single data frame.
Usage
## S3 method for class 'dust'
as.data.frame(x, ..., sprinkled = TRUE)
## S3 method for class 'dust_list'
as.data.frame(x, ...)
Arguments
x |
A |
... |
Arguments to be passed to other methods. Currently unused. |
sprinkled |
Logical. If |
Details
In its current state, this can be a fairly inefficient function
as the table, if the longtable option is in use, will be built in
a for loop and bound together using rbind. This isn't
really intended for large tables, but may be of assistance when
there isn't a sprinkle that does what you want to do. (You can
at least pull out the object as a data frame and do your own
post processing).
Functional Requirements
Accepts an object of class
dustordust_listAccepts a
logical(1)indicating if the sprinkles should be applied to the data.For a
dustobject, returns an object of classdata.frameFor a
dust_listobject, returns a list of objects of classdata.frame
Author(s)
Benjamin Nutter
Examples
fit <- lm(mpg ~ qsec + factor(am) + wt * factor(gear), data = mtcars)
Dust <- dust(fit) %>%
sprinkle(cols = 2:4, round = 2) %>%
sprinkle(cols = 5, fn = quote(pvalString(value))) %>%
sprinkle(cols = 3, font_color = "#DA70D6") %>%
sprinkle_print_method("html")
as.data.frame(Dust)