# NOT RUN {
data(Election2005)
# }
# NOT RUN {
# Define new variable which explains affiliation of the constituencies
# to east Germany, west Germany and Berlin
OstWest <- ifelse(Election2005$Land %in%
c("Thueringen","Sachsen","Sachsen-Anhalt",
"Brandenburg","Mecklenburg-Vorpommern"), "Ost", "West")
Election2005$OstWestBerlin <-
as.factor(ifelse(Election2005$Land == "Berlin","Berlin",OstWest))
# Calculate measure groups
groupm <- groups(Election2005, "OstWestBerlin")
# Show highest values
groupm[with(groupm,order(groups,decreasing=TRUE))[1:10],]
# }
Run the code above in your browser using DataLab