serVis: View and/or share LDAvis in a browser

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/serVis.R

Description

View and/or share LDAvis in a browser.

Usage

1
2
3
serVis(json, out.dir = tempfile(), open.browser = interactive(),
  as.gist = FALSE, language = "english", encoding = getOption("encoding"),
  ...)

Arguments

json

character string output from createJSON.

out.dir

directory to store html/js/json files.

open.browser

Should R open a browser? If yes, this function will attempt to create a local file server via the servr package. This is necessary since the javascript needs to access local files and most browsers will not allow this.

as.gist

should the vis be uploaded as a gist? Will prompt for an interactive login if the GITHUB_PAT environment variable is not set. For more details, see https://github.com/ropensci/gistr#authentication.

language

Which language to use in visualization? So far: english or polish.

encoding

Sets the encoding to be used when writing the JSON file.

...

arguments passed onto gistr::gist_create

Details

This function will place the necessary html/js/css files (located in system.file("htmljs", package = "LDAvis")) in a directory specified by out.dir, start a local file server in that directory (if necessary), and (optionally) open the default browser in this directory. If as.gist=TRUE, it will attempt to upload these files as a gist (in this case, please make sure you have the gistr package installed as well as your 'github.username' and 'github.password' set in options.)

Value

An invisible object.

Author(s)

Carson Sievert

See Also

createJSON

Examples

1
2
3
4
5
## Not run: 
# Use of serVis is documented here:
help(createJSON, package = "LDAvis")

## End(Not run)

cpsievert/LDAvis documentation built on May 13, 2019, 10:54 p.m.