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")
Run the code above in your browser using DataLab