library(polmineR) library(gradget) library(magrittr) library(pbapply) library(igraph)
runcode <- if (require("GermaParl", quietly = TRUE)) TRUE else FALSE if (runcode) use ("GermaParl")
G <- merkel2008 igraph_as_svg(merkel2008) %>% plot()
use("GermaParl") bt2008 <- partition("GERMAPARL", year = 2008) kwic(bt2008, query = "Integration")
merkel2008 <- partition( "GERMAPARL", speaker = "Angela Merkel", year = 2008, interjection = FALSE, p_attribute = "word" ) terms_to_drop <- p_attributes(merkel2008, p_attribute = "word") %>% noise(verbose = FALSE) %>% unlist() %>% unname() %>% c(polmineR::punctuation) G <- Cooccurrences(merkel2008, "word", 5L, 5L, terms_to_drop) %>% ll() %>% decode() %>% subset(rank_ll <= 250) %>% kwic() %>% as_igraph() %>% igraph_add_coordinates(layout = "kamada.kawai", dim = 3) %>% igraph_add_communities() %>% rescale(-250, 250) # G <- igraph_add_kwic(G, subcorpus = merkel2008) GR <- gradget::igraph_as_gradget_data(G) Y <- three(GR, knitr = TRUE, raycaster = TRUE) Y
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.