View source: R/as.data.frame.dust.R
as.data.frame.dust | R Documentation |
dust
Object to Data FrameSprinkles 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.
## S3 method for class 'dust'
as.data.frame(x, ..., sprinkled = TRUE)
## S3 method for class 'dust_list'
as.data.frame(x, ...)
x |
A |
... |
Arguments to be passed to other methods. Currently unused. |
sprinkled |
Logical. If |
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).
Accepts an object of class dust
or dust_list
Accepts a logical(1)
indicating if the sprinkles should
be applied to the data.
For a dust
object, returns an object of class
data.frame
For a dust_list
object, returns a list of objects of class
data.frame
Benjamin Nutter
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.