ds.summaryVars: Executes ds.summary function for variables in a data.frame

View source: R/ds.summaryVars.R

ds.summaryVarsR Documentation

Executes ds.summary function for variables in a data.frame

Description

The function executes the ds.summary function for all numeric or integer variables of a data.frame.

Usage

ds.summaryVars(df = "D", datasources = NULL, save = FALSE)

Arguments

df

A data.frame on the server-side.

datasources

A list of DSConnection-class objects obtained after login. If the datasources argument is not specified the default set of connections will be used: see datashield.connections_default.

save

if TRUE, the output is saved in the working directory as a csv fil. Default is FALSE. It runs the datashield function ds.summary()and calculates the standard deviation in all numeric and integer variables of each OpalConnection

Details

ds.summaryVars analyses the classes of variables of a server-side data.frame and executes the ds.summary function for all variables which are of type 'numeric' or 'integer'. Additionally, it also provides the standard deviation for those variables.

Value

a list with the summary of each variable

Author(s)

Sofia Siampani (Max-Delbrueck-Center, Berlin), Florian Schwarz (German Institute of Human Nutrition, Potsdam-Rehbruecke)

Examples

## Not run: 

# Version 1.0
# Connecting to Opal Servers

# loading necessary packages
require("DSI")
require("DSOpal")
require("dsBaseClient")
require("dsSupportClient")

builder <- DSI::newDSLoginBuilder()
builder$append(server = "study1",
               url = "http://192.168.56.100:8080/",
               user = "administrator", password = "datashield_test&",
               table = "CNSIM.CNSIM1", driver = "OpalDriver")
builder$append(server = "study2",
               url = "http://192.168.56.100:8080/",
               user = "administrator", password = "datashield_test&",
               table = "CNSIM.CNSIM2", driver = "OpalDriver")
builder$append(server = "study3",
               url = "http://192.168.56.100:8080/",
               user = "administrator", password = "datashield_test&",
               table = "CNSIM.CNSIM3", driver = "OpalDriver")

logindata <- builder$build()

# Log onto the remote Opal training servers
connections <- DSI::datashield.login(logins = logindata, assign = TRUE, symbol = "D")

# Retrieving information on variable classes in the specified data.frame
ds.summaryVars(df = "D", save = TRUE)

# Clear the Datashield R sessions and logout
datashield.logout(connections)


## End(Not run)

sofiasiamp/datashieldDescriptives documentation built on Oct. 31, 2024, 10:25 a.m.