rcloud.get.asset {rcloud.support}R Documentation

Access and execute notebook assets

Description

rcloud.get.asset retrieves a notebook asset

rcloud.execute.asset retrieves a notebook asset as a file and executes it

Usage

rcloud.get.asset(name, notebook = rcloud.session.notebook(), version = NULL,
                 cached = TRUE, quiet = FALSE, as.file = FALSE)
rcloud.execute.asset(name, ..., notebook = rcloud.session.notebook(), version = NULL,
                 cached = TRUE, wait = TRUE, env = FALSE)

Arguments

name

name of the asset

notebook

notebook object or notebook ID

version

version to retrieve or NULL for the latest version

cached

logical, if TRUE then a cached version will be used if available (typically only the session notebook is cached)

quiet

logical, if TRUE then a non-existent asset will not raise an error but return NULL instead

as.file

logical, if TRUE then the asset is stored in a file and the result is the full path to the resulting file, otherwise the asset content is returned directly

...

any additional arguments to pass to the interpreter running the asset

env

only used for R assets, either en environment in which to evaluate the code or FALSE for global environment or TRUE for a local environment

Details

rcloud.get.asset loads a notebook and retrieves the asset of the name name from the notebook.

rcloud.execute.asset first calls rcloud.get.asset(..., as.file=TRUE) and then executes the resulting file. If the file has a known extension the driver for the file is executed with the filename instead of the file itself. For R assets the file is sourced instead of shell execution, so it is equivalent to sourcing the file in the R session while env corresponds to the local argument of source(). In all other cases the file is made executable and executed.

Value

rcloud.get.asset: if as.file=TRUE then a path to the file containing the asset contents, otherwise the asset itself (character vector for text content, raw vector for binary content)

rcloud.execute.asset: for R assets the evaluation result, for all other assets the result of the system() call.

Author(s)

Simon Urbanek


[Package rcloud.support version 2.3-1 Index]