rave-session | R Documentation |
Create, register, list, and remove 'RAVE' sessions
new_session(update = FALSE) use_session(x) launch_session( x, host = "127.0.0.1", port = NULL, options = list(jupyter = TRUE, jupyter_port = NULL, as_job = TRUE, launch_browser = TRUE, single_session = FALSE) ) session_getopt(keys, default = NA, namespace = "default") session_setopt(..., .list = NULL, namespace = "default") remove_session(x) remove_all_sessions() list_session(path = session_root(), order = c("none", "ascend", "descend")) start_session( session, new = NA, host = "127.0.0.1", port = NULL, jupyter = NA, jupyter_port = NULL, as_job = TRUE, launch_browser = TRUE, single_session = FALSE ) shutdown_session( returnValue = invisible(), session = shiny::getDefaultReactiveDomain() )
update |
logical, whether to update to latest 'RAVE' template |
host |
host 'IP' address, default is 'localhost' |
port |
port to listen |
options |
additional options, including |
keys |
vector of characters, one or more keys of which the values should be obtained |
default |
default value if key is missing |
namespace |
namespace of the option; default is |
..., .list |
named list of key-value pairs of session options. The keys must be characters, and values must be simple data types (such as numeric vectors, characters) |
path |
root path to store the sessions; default is the
|
order |
whether to order the session by date created; choices are
|
session, x |
session identification string, or session object; use
|
new |
whether to create a new session instead of using the most recent one, default is false |
jupyter |
logical, whether to launch 'jupyter' instance as well. It requires additional setups to enable 'jupyter' lab |
jupyter_port |
port used by 'jupyter' lab, can be set by
|
as_job |
whether to launch the application as 'RStudio' job, default is true if 'RStudio' is detected; when running without 'RStudio', this option is always false |
launch_browser |
whether to launch browser, default is true |
single_session |
whether to enable single-session mode. Under this mode, closing the main frame will terminate 'RAVE' run-time session, otherwise the 'RAVE' instance will still open in the background |
returnValue |
passed to |
new_session
returns a session object with character
'session_id'
and a function 'launch_session'
to launch the
application from this session
use_session
returns a session object, the same as
new_session
under the condition that corresponding session exists,
or raise an error if the session is missing
list_session
returns a list of all existing session objects under the session root
remove_session
returns a logical whether the corresponding session has been found and removed
if(interactive()){ sess <- new_session() sess$launch_session() all_sessions <- list_session() print(all_sessions) # Use existing session session_id <- all_sessions[[1]]$session_id sess <- use_session(session_id) sess$launch_session() # Remove session remove_session(session_id) list_session() }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.