Title: | Client-Side R API Wrapper for Peer Models Network Model Repository |
---|---|
Description: | Enables direct cloud access to health care decision models hosted on the PRISM server of the Peer Models Network. |
Authors: | amin adibi [aut, cre], Mohsen Sadatsafavi [aut, cph] |
Maintainer: | amin adibi <[email protected]> |
License: | GPL-3 |
Version: | 0.10.3 |
Built: | 2025-03-11 02:59:36 UTC |
Source: | https://github.com/cran/peermodels |
Returns the default server path for PRISM server
default_server()
default_server()
the default server path for PRISM server
draws plots generated by the model in R Session
draw_plots(plot_number = NULL)
draw_plots(plot_number = NULL)
plot_number |
the number of the plot to be rendered |
graphical object in R
Retrieves async results
get_async_results( model_name = NULL, token = NULL, api_key = NULL, server = NULL )
get_async_results( model_name = NULL, token = NULL, api_key = NULL, server = NULL )
model_name |
name of the model |
token |
async job token |
api_key |
API key |
server |
Server address. Defaults to PMN. |
processed (from JSON to R object result of the call)
Returns default PRISM model input
get_default_input(model_name = NULL, api_key = NULL, server = NULL)
get_default_input(model_name = NULL, api_key = NULL, server = NULL)
model_name |
name of the model. If null, it will be set to the last call's value. |
api_key |
API key. If null, it will be set to the last call's value. |
server |
Server address. If null, it will be set to Peer Models Network PRISM server on the first run and to the last call's value on subsequent runs. |
default model inputs, which can be changed and submitted to the model for a different run.
## Not run: sample_input <- get_default_input(model_name = "accept", api_key = "YOUR_API_KEY") ## End(Not run)
## Not run: sample_input <- get_default_input(model_name = "accept", api_key = "YOUR_API_KEY") ## End(Not run)
Retrieves plots generated by the model in R Session
get_plots()
get_plots()
URL of plots
returns session info
get_session()
get_session()
returns current session variables
checks to see if a model is available on the cloud server
handshake(model_name, server = default_server())
handshake(model_name, server = default_server())
model_name |
name of the model |
server |
base url of the server |
TRUE if model is available on the server, FALSE otherwise
handshake("accept")
handshake("accept")
Executes PRISM model
model_run( model_name = NULL, model_input = NULL, api_key = NULL, server = NULL, async = FALSE, email_address = NULL )
model_run( model_name = NULL, model_input = NULL, api_key = NULL, server = NULL, async = FALSE, email_address = NULL )
model_name |
name of the model |
model_input |
required custom parameters for current model |
api_key |
API key |
server |
server address. Defaults to the Peer Models Network PRSIM repository. |
async |
should the model be called in async mode? |
email_address |
async results will be emailed to this address |
0 for success and 1 for error
## Not run: sample_input <- get_default_input(model_name = "epic", api_key = "YOUR_API_KEY") sample_input$global_parameters.time_horizon <- 15 model_run ("epic", model_input = sample_input) ## End(Not run)
## Not run: sample_input <- get_default_input(model_name = "epic", api_key = "YOUR_API_KEY") sample_input$global_parameters.time_horizon <- 15 model_run ("epic", model_input = sample_input) ## End(Not run)
Generic call to PRISM server
prism_call(func, base_url, api_key = NULL, ...)
prism_call(func, base_url, api_key = NULL, ...)
func |
function to call |
base_url |
the url to call |
api_key |
API key |
... |
other parameters |
processed (from JSON to R object result of the call)
resets session info and clears stored environmental variables such as API keys and server address.
reset_session()
reset_session()