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