Set DataSHIELD method

dsadmin.set_method(
  opal,
  name,
  func = NULL,
  path = NULL,
  type = "aggregate",
  profile = NULL
)

Arguments

opal

Opal object or list of opal objects.

name

Name of the method, as it will be accessed by DataSHIELD users.

func

Function name or function code.

path

Path to the R file containing the script (mutually exclusive with func).

type

Type of the method: "aggregate" (default) or "assign"

profile

The DataSHIELD profile name to which operation applies. See also dsadmin.profiles.

Examples

if (FALSE) {
o <- opal.login('administrator','password', url='https://opal-demo.obiba.org')
# as a package's function
dsadmin.set_method(o, 'foo', func = 'base::mean')
# as a custom function
dsadmin.set_method(o, 'foo', func = function(x) { base::mean(x) })
opal.logout(o)
}