Description Usage Arguments Examples
Generate 3d graph with three.js
1 2 3 4 5 6 | gradget(data, bgColor = "0x888888", raycaster = TRUE, anaglyph = FALSE,
knitr = FALSE, width = NULL, height = NULL, elementId = "gradget")
gradgetOutput(outputId, width = "100%", height = "400px")
renderGradget(expr, env = parent.frame(), quoted = FALSE)
|
data |
Input data. |
bgColor |
Background color, a hex value (defaults to "0x888888"). |
raycaster |
... |
anaglyph |
... |
knitr |
A logical value, whether htmlwidget is embedded in knitr/Rmarkdown document. If TRUE, corners will be somewhat rounded, and a sizing mechanism will ensure that the chunk option is processed appropriately (best practice: fig.width = 9.5). |
width |
... |
height |
... |
elementId |
Passed into |
outputId |
output variable to read from |
expr |
An expression that generates an HTML widget |
env |
The environment in which to evaluate expr. |
quoted |
Is |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | library(gradget)
library(polmineR)
library(magrittr)
use("GermaParl")
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) %>%
as_igraph() %>%
igraph_add_coordinates(layout = "kamada.kawai", dim = 3) %>%
igraph_add_communities() %>%
rescale(-250, 250)
G <- igraph_add_kwic(G, subcorpus = merkel2008)
D <- igraph_as_gradget_data(G)
W <- gradget(D, raycaster = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.