ds.numNA {dsBaseClient}R Documentation

Gets the number of missing values in a vector

Description

In DataSHIELD it is not possible to visualize the data. This function helps to know the number of missing values in a vector to eventually use a vector of equal length (i.e. the count of missing entries) to replace the missing values.

Usage

ds.numNA(x = NULL, datasources = NULL)

Arguments

x

a character, the name of a vector to check for missing entries.

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 vector to check for missing values might be a in a table structure or not. The number of missing entries are counted and the total for each study is returned.

Value

for an array, NULL or a vector of mode integer

Author(s)

Gaye, A.

Examples

{

  # load that contains the login details
  data(logindata)

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

  # Example 1: Get the number of missing values in the variable 'LAB_HDL' held in the table 'D'.
  ds.numNA(x='D$LAB_HDL')

  # Example 2: Assign the above variable and check the number of missing values on the now loose
  # variable 'LAB_HDL'.
  ds.assign(toAssign='D$LAB_HDL', newobj='labhdl')

  # Example 3: Get the pooled dimension of the assigned datasets
  ds.numNA(x='labhdl')

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

}

[Package dsBaseClient version 4.1.0 ]