ds.length: Gets the length of a vector or list

Description Usage Arguments Details Value Author(s) Examples

Description

This function is similar to R function length.

Usage

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

Arguments

x

a string character, the name of a vector

type

a character which represents the type of analysis to carry out. If type is set to 'combine', a global variance is calculated if type is set to 'split', the variance 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 dataframe, from opal datasources.

Details

The function returns the pooled length or the length of the a vector or a list for each study.

Value

a numeric, the number of elements of the input vector or list.

Author(s)

Gaye, A.

Examples

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

  # load that contains the login details
  data(logindata)

  # login and assign all the variables stored on the server side
  opals <- datashield.login(logins=logindata,assign=TRUE)

  # Example 1: Get the total number of observations across all the studies for the variable 'LAB_TSC' - default behaviour
  ds.length(x='D$LAB_TSC')

  # Example 2: Get the number of observations on each study, for the variable 'LAB_TSC'
  ds.length(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.