widgetThumbnail | R Documentation |
Capture html output widget as .png in R
widgetThumbnail(p, thumbName, width = 1024, height = 1024)
p |
is the html widget |
thumbName |
is the name of the new png file |
width |
1024 |
height |
1024 |
3 files .html, .js and .png
How <- "runManually"
## Not run:
# Load package
library(networkD3)
library(htmlwidgets)
# Create fake data
src <- c("A", "A", "A", "A", "B", "B", "C", "C", "D")
target <- c("B", "C", "D", "J", "E", "F", "G", "H", "I")
networkData <- data.frame(src, target)
# Plot
plot = simpleNetwork(networkData)
# Save html as png
widgetThumbnail(p = plot, thumbName = "plot", width = 1024, height = 1024)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.