View source: R/PA.EMOA.dataprocessing.R
addUnionGroup | R Documentation |
Consider a data frame with results of multi-objective stochastic optimizers on
a set of problems from different categories/groups (say indicated by column “group”).
Occasionally, it is useful to unite the results of several groups into a meta-group.
The function addUnionGroup
aids in generation of such a meta-group while
function addAllGroup
is a wrapper around the former which generates a
union of all groups.
addUnionGroup(df, col, group, values)
addAllGroup(df, col, group = "all")
df |
[ |
col |
[ |
group |
[ |
values |
[ |
[data.frame
] Modified data frame.
df = data.frame(
group = c("A1", "A1", "A2", "A2", "B"),
perf = runif(5),
stringsAsFactors = FALSE)
df2 = addUnionGroup(df, col = "group", group = "A", values = c("A1", "A2"))
df3 = addAllGroup(df, col = "group", group = "ALL")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.