plot_htmlwidget: Export cooccurence tables as an image.

Description Usage Arguments Details Author(s) Examples

View source: R/plot_htmlwidget.R

Description

This function allow users to display cooccurence tables from the cooccurExtra in a word or pdf document. Since by default htmlwidget objects cannot be displayed in word or pdf documents. This function also allow users to save these tables as a PNG locally.

Usage

1
plot_table(widget, file = NULL)

Arguments

widget

htmlwidget object.

file

The name of the file where the data will be saved. Default to NULL, no saving required.

Details

To render the htmlwidget into an image. A headless browser is used to capture it, to do this the Chrome Dev Tool is used, the chromote package provides this functionality.

Author(s)

Yingjia J He, Charco Hui

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
  # require packages
  # devtools::install_github("rstudio/chromote")
  # install.packages("showimage")
  library(chromote)
  library(showimage)
  
  # ask for a "coocana" output model
  data(modelca)
  
  # get the output from displaytable function
  mytest = displaytable(mymod = modelca)
  
  # get the plots from 
  plot_htmlwidget(mytest$STATSFT)
  plot_htmlwidget(mytest$SIGNFT)

JotSoSerious/cooccurExtra documentation built on Oct. 30, 2019, 8:03 p.m.