ds.mice.cc: Select complete cases

Description Usage Arguments Examples

Description

Extracts the complete cases, also known as listwise deletion. cc(x) is similar to na.omit(x), but returns an object of the same class as the input data. Dimensions are not dropped.

Usage

1
ds.mice.cc(varname = NULL, x = NULL, checks = TRUE, datasources = NULL)

Arguments

varname

A character object that will be the name of the variable to which the result of the function will be assigned on the server-side

x

An R object. Methods are available for classes mids, data.frame and matrix. Also, x could be a vector.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# In this example, we assume that the Opal server to which we are connecting, 
# has a table that contains the 'boys' data from the original mice package.

library(dsBaseClient)
library(dsMiceClient)

# Build login information
server <- c("server_name")
url <- c("opal_url")
user <- "username"
password <- "password"
table <- c("project_name.table_name")
logindata <- data.frame(server,url,user,password,table)

# Login and assign the 'boys' dataset to varable 'D' on the server-side
opals<-datashield.login(logins=logindata, assign=TRUE)

# Check dimension of D
ds.dim('D')

# Extract complete cases from D and assign result to D2
ds.mice.cc("D2", "D")

# Check dimension of D2 (should be equal to or smaller than dim of D)
ds.dim('D2')

gflcampos/dsMiceClient documentation built on May 3, 2019, 4:33 p.m.