library(polmineR) use("GermaParl") library(magrittr) library(data.table)
Q <- '"Nachhaltigkeit.*"'
cnt <- count("GERMAPARL", query = Q, cqp = TRUE, breakdown = TRUE) cnt[, "query" := NULL] colnames(cnt) <- c("Wortform", "Häufigkeit", "Anteil") DT::datatable(cnt)
# p <- partition("GERMAPARL", role = c("government", "mp"), interjection = FALSE) # d <- dispersion(p, query = Q, s_attribute = "party") d <- dispersion("GERMAPARL", query = Q, s_attribute = "party") d <- d[!party %in% c("parteilos", "")] d <- rbind( d, data.table( party = "PDS/LINKE", count = d[party == "LINKE"][["count"]] + d[party == "PDS"][["count"]] ) ) d <- d[!party %in% c("PDS", "LINKE")] setorderv(d, cols = "party") s <- size("GERMAPARL", s_attribute = "party") s <- rbind( s, data.table( party = "PDS/LINKE", size = s[party == "LINKE"][["size"]] + s[party == "PDS"][["size"]] ) ) s <- s[party %in% d[["party"]]] setorderv(s, cols = "party") d[, "size" := s[["size"]] ] d[, "freq" := count / size * 100000] colors <- c( "CDU" = "black", CSU = "blue", FDP = "yellow", SPD = "red", GRUENE = "green", "PDS/LINKE" = "pink" ) par(mfrow = c(1,2)) setorderv(d, cols = "freq", order = -1L) barplot( height = d[["count"]], names.arg = d[["party"]], las = 2, cex.names = 0.7, col = colors[d[["party"]]], main = "absolute Häufigkeit" ) barplot( height = d[["freq"]], names.arg = d[["party"]], las = 2, cex.names = 0.7, col = colors[d[["party"]]], main = "Anteil (pro 100.000 Worte)" )
"GERMAPARL" %>% cooccurrences(query = Q, cqp = TRUE, p_attribute = c("pos", "word")) %>% subset(pos %in% c("NN", "ADJA", "ADJD")) %>% subset(count_window >= 5) %>% format() %>% DT::datatable()
partition("GERMAPARL", parliamentary_group = "CDU/CSU") %>% cooccurrences(query = Q, cqp = TRUE, p_attribute = c("pos", "word")) %>% subset(pos %in% c("NN", "ADJA", "ADJD")) %>% subset(count_window >= 5) %>% format() %>% DT::datatable()
partition("GERMAPARL", parliamentary_group = "FDP") %>% cooccurrences(query = Q, cqp = TRUE, p_attribute = c("pos", "word")) %>% subset(pos %in% c("NN", "ADJA", "ADJD")) %>% subset(count_window >= 5) %>% format() %>% DT::datatable()
partition("GERMAPARL", parliamentary_group = "SPD") %>% cooccurrences(query = Q, cqp = TRUE, p_attribute = c("pos", "word")) %>% subset(pos %in% c("NN", "ADJA", "ADJD")) %>% subset(count_window >= 5) %>% format() %>% DT::datatable()
partition("GERMAPARL", parliamentary_group = c("GRUENE")) %>% cooccurrences(query = Q, cqp = TRUE, p_attribute = c("pos", "word")) %>% subset(pos %in% c("NN", "ADJA", "ADJD")) %>% subset(count_window >= 5) %>% format() %>% DT::datatable()
partition("GERMAPARL", parliamentary_group = c("PDS", "LINKE")) %>% cooccurrences(query = Q, cqp = TRUE, p_attribute = c("pos", "word")) %>% subset(pos %in% c("NN", "ADJA", "ADJD")) %>% subset(count_window >= 5) %>% format() %>% DT::datatable()
options("polmineR.pagelength" = 8) kwic("GERMAPARL", query = Q, s_attributes = c("date", "party", "speaker"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.