widgetThumbnail: Capture html output widget as .png in R

View source: R/phantomJS.R

widgetThumbnailR Documentation

Capture html output widget as .png in R

Description

Capture html output widget as .png in R

Usage

widgetThumbnail(p, thumbName, width = 1024, height = 1024)

Arguments

p

is the html widget

thumbName

is the name of the new png file

width

1024

height

1024

Value

3 files .html, .js and .png

Examples

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)

kmezhoud/bioCancer documentation built on Feb. 17, 2024, 10:29 a.m.