shinylight.runR {shinylight}R Documentation

JavaScript function: Runs an R function.

Description

The R side must be running the slRunRServer function.

Arguments

rCommand

string The R text to run. It can plot a graph and/or return some R data structure (such as a data frame).

data

any A javascript value that will be translated to the R command as a value also called 'data'.

plotElement

string, HTMLElement If provided, the <img> element (or id of the element) that will receive the plot output (if any). The plot returned will be the size that this element already has, so ensure that it is styled in a way that it has the correct size even if no image (or an old image) has been set.

extra

object [optional] An object whose keys can be: "imgType": Type of image required, "png" (default) or "svg"; "info": Function to be called if the R function sendInfoText is called; "progress": Function to be called if the R function sendProgress is called.

Value

Result object that might have a plot property (giving a string that would work as the src attribute of an img element, representing graphics drawn by the command) and a data property (giving the value returned by the command). If the promise resolves to an error, the argument to the error function is a string representing the cause of the error.


[Package shinylight version 1.2 Index]