| Lightning {LightningR} | R Documentation |
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
Format
R6Class object.
Value
Object of R6Class with methods for communication with lightning-viz server.
Fields
serveraddressStores address of your lightning server.
sessionidStores id of your current session on the server.
urlStores url of the last visualization created by this object.
autoopenChecks if the server is automatically opening the visualizations.
notebookChecks 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
serveraddressas 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
sessionidparameter.openviz(vizid = NA)This method by default opens most recently created by this object visualization. If
vizidparameter 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, yvectors, with connection given inmatrixconnectivity 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
regionswith weights given inweightsvector and withcolormapcolor (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, yvectors, with connection given inmatrixconnectivity matrix. Lines on this graph are stacked a bit more than in thegraphfunction.matrix(matrix, colormap)This method creates a visualization of matrix given in
matrixparameter, with its contents used as weights for the colormap given incolormap(string from colorbrewer).adjacency(matrix, label = NA)This method creates a visualization for adjacency matrix given in
matrixparameter.scatterline(x, y, t, color = NA, label = NA, size = NA)This method creates a scatterplot for coordinates in vectors
x, yand assignes a line plot to every point on that plot. Each line is given as a row intmatrix.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
imgpathto the server and creates a visualisation of it.gallery(imgpathvector)This method uploads images from vector of file paths
imgpathvectorto the server and creates a gallery of these images.
Examples
Lightning$new("http://localhost:3000/")
Lightning$new("http://your-lightning.herokuapp.com/")