ds.meanDS: Computes the statistical mean of a given vector

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This function is similar to the R function mean.

Usage

1
2
ds.meanDS(x = NULL, type = "combine", checks = FALSE,
  datasources = NULL)

Arguments

x

a character, the name of a numerical vector

type

a character which represents the type of analysis to carry out. If type is set to 'combine', a global mean is calculated if type is set to 'split', the mean is calculated separately for each study.

checks

a boolean, if TRUE (default) checks that verify elements on the server side such checks lengthen the run-time so the default is FALSE and one can switch these checks on (set to TRUE) when faced with some error(s).

datasources

a list of opal object(s) obtained after login in to opal servers; these objects hold also the data assign to R, as data frame, from opal datasources.

Details

It is a wrapper for the server side function.

Value

a numeric

Author(s)

Gaye A., Isaeva I.

See Also

ds.quantileMean to compute quantiles.

ds.summary to generate the summary of a variable.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
{

  # load that contains the login details
  data(logindata)

  # login and assign specific variable(s)
  myvar <- list('LAB_TSC')
  opals <- datashield.login(logins=logindata,assign=TRUE,variables=myvar)

  # Example 1: compute the pooled statistical mean of the variable 'LAB_TSC' - default behaviour
  ds.mean(x='D$LAB_TSC')

  # Example 2: compute the statistical mean of each study separately
  ds.mean(x='D$LAB_TSC', type='split')

  # clear the Datashield R sessions and logout
  datashield.logout(opals)

}

paularaissa/dsTutorialClient documentation built on May 29, 2019, 7:36 a.m.