as_mi_df | R Documentation |
as_mi_df()
turns an existing object, such as a data frame, into a MI
data frame, a data frame with 'mi_df'. This is in contrast with
mi_df()
, which builds a MI data frame from individual columns.
as_mi_df( x, bag_label = "bag_label", bag_name = "bag_name", instance_label = "instance_label", ... )
x |
A data-frame or similar to convert. |
bag_label |
A character (default |
bag_name |
A character (default |
instance_label |
A character (default |
... |
Arguments reserved for other methods. |
A 'mi_df' object. This data.frame-like has columns bag_label
,
bag_name
, and potentially others. It also inherits from the
'tbl_df'
and 'tbl'
classes.
Sean Kent
mi_df()
to build a mi_df
object.
x = data.frame('bag_LABEL' = factor(c(1, 1, 0)), 'bag_name' = c(rep('bag_1', 2), 'bag_2'), 'X1' = c(-0.4, 0.5, 2), 'instance_label' = c(0, 1, 0)) df <- as_mi_df(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.