Learn R Programming

LightningR (version 1.0.2)

Lightning: Class providing object with methods for communication with lightning-viz server

Description

Class providing object with methods for communication with lightning-viz server

Usage

Lightning

Arguments

Value

Object of R6Class with methods for communication with lightning-viz server.

Format

R6Class object.

Fields

serveraddress
Stores address of your lightning server.
sessionid
Stores id of your current session on the server.
url
Stores url of the last visualization created by this object.
autoopen
Checks if the server is automatically opening the visualizations.
notebook
Checks if the server is in the jupyter notebook mode. #'

Methods

Documentation
For full documentation of each method go to https://github.com/lightning-viz/lightining-r/
new(serveraddress)
This method is used to create object of this class with serveraddress as address of the server object is connecting to.
sethost(serveraddress)
This method changes server that you are contacting with to serveraddress.
createsession(sessionname = "")
This method creates new session on the server with optionally given name in sessionname.
usesession(sessionid)
This method changes currently used session on the server to the one with id given in sessionid parameter.
openviz(vizid = NA)
This method by default opens most recently created by this object visualization. If vizid parameter is given, it opens a visualization with given id instead.
enableautoopening()
This method enables auto opening of every visualisation that you create since that moment. Disabled by default.
disableautoopening()
This method disables auto opening of every visualisation that you create since that moment. Disabled by default.
line(series, index = NA, color = NA, label = NA, size = NA, xaxis = NA, yaxis = NA, logScaleX = "false", logScaleY = "false")
This method creates a line visualization for vector/matrix with each row representing a line, given in series.
scatter(x, y, color = NA, label = NA, size = NA, alpha = NA, xaxis = NA, yaxis = NA)
This method creates a scatterplot for points with coordinates given in vectors x, y.
linestacked(series, color = NA, label = NA, size = NA)
This method creates a plot of multiple lines given in matrix series, with an ability to hide and show every one of them.
force(matrix, color = NA, label = NA, size = NA)
This method creates a force plot for matrix given in matrix.
graph(x, y, matrix, color = NA, label = NA, size = NA)
This method creates a graph of points with coordinates given in x, y vectors, with connection given in matrix connectivity matrix.
map(regions, weights, colormap)
This method creates a world (or USA) map, marking regions given as a vector of abbreviations (3-char for countries, 2-char for states) in regions with weights given in weights vector and with colormap color (string from colorbrewer).
graphbundled(x, y, matrix, color = NA, label = NA, size = NA)
This method creates a bundled graph of points with coordinates given in x, y vectors, with connection given in matrix connectivity matrix. Lines on this graph are stacked a bit more than in the graph function.
matrix(matrix, colormap)
This method creates a visualization of matrix given in matrix parameter, with its contents used as weights for the colormap given in colormap (string from colorbrewer).
adjacency(matrix, label = NA)
This method creates a visualization for adjacency matrix given in matrix parameter.
scatterline(x, y, t, color = NA, label = NA, size = NA)
This method creates a scatterplot for coordinates in vectors x, y and assignes a line plot to every point on that plot. Each line is given as a row in t matrix.
scatter3(x, y, z, color = NA, label = NA, size = NA, alpha = NA)
This method creates a 3D scatterplot for coordinates given in vectors x, y, z.
image(imgpath)
This method uploads image from file imgpath to the server and creates a visualisation of it.
gallery(imgpathvector)
This method uploads images from vector of file paths imgpathvector to the server and creates a gallery of these images.

Examples

Run this code
Lightning$new("http://localhost:3000/")
Lightning$new("http://your-lightning.herokuapp.com/")

Run the code above in your browser using DataLab