Description Usage Arguments Value Examples
This function creates new dataframe with political groups as a result of aggregating selected parties.
1 | newgroupby(df, groups, keep)
|
df |
The |
groups |
List with the desired groups with the |
keep |
What columns of the inputted |
Returns a dataframe
containing the rows from the inputted dataframe
listed in keep
and the columns in the list
inputted under groups.
1 2 3 4 5 6 7 8 9 10 11 | Country <- c("Austria", "Belgium", "Bulgaria")
EPP <- c(1,2,3)
SD <- c(1,2,3)
Other <- c(1,1,1)
IN <- c(1,1,1)
df.data <- data.frame(Country, EPP, SD, Other, IN)
groups <- groups <- list(
"traditional" = c("EPP", "SD"),
"non_attached" = c("IN", "Other"))
newgroupby(df.data, groups, "Country")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.