ds.plotsurvfit: Performs plotting of privacy preserving survival curves in...

View source: R/ds.plotsurvfit.R

ds.plotsurvfitR Documentation

Performs plotting of privacy preserving survival curves in DataSHIELD.

Description

Performs plotting of privacy preserving survival curves.

Usage

ds.plotsurvfit(
  formula = NULL,
  dataName = NULL,
  fun = NULL,
  datasources = NULL,
  xlab = "",
  ylab = "",
  ggplot = FALSE
)

Arguments

formula

character string specifying the name of survfit object on the server-side created using ds.survfit(). For more information see Details.

dataName

character string of name of data frame

fun

optional parameter to have an argument. For example, you can pass 'cloglog' for a log-log survival plot.

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.

xlab

X-axis label, a character string. Default value is ”.

ylab

Y-axis label, a character string. Default value is ”.

Details

This is a server-side function that plots privacy preserving survival curves in DataSHIELD.

Server function called: plotsurvfitDS.

Value

privacy preserving survival curve from the server side environment.

Author(s)

Soumya Banerjee, Demetris Avraam, Paul Burton, Xavier Escriba-Montagut, Juan Gonzalez and Tom RP Bishop (2022).

Examples

## Not run: 

  ## Version 2.0
  
  # connecting to the Opal servers

  require('DSI')
  require('DSOpal')
  require('dsBaseClient')
  library(dsSurvivalClient)

  builder <- DSI::newDSLoginBuilder()
  builder$append(server = "study1", 
                 url = "http://192.168.56.100:8080/", 
                 user = "administrator", password = "datashield_test&", 
                 table = "SURVIVAL.EXPAND_NO_MISSING1", driver = "OpalDriver")
  builder$append(server = "study2", 
                 url = "http://192.168.56.100:8080/", 
                 user = "administrator", password = "datashield_test&", 
                 table = "SURVIVAL.EXPAND_NO_MISSING2", driver = "OpalDriver")
  builder$append(server = "study3",
                 url = "http://192.168.56.100:8080/", 
                 user = "administrator", password = "datashield_test&", 
                 table = "SURVIVAL.EXPAND_NO_MISSING3", driver = "OpalDriver")
  logindata <- builder$build()
  
  connections <- DSI::datashield.login(logins = logindata, assign = TRUE, symbol = "D") 
  
  # make sure that the outcome is numeric 
  ds.asNumeric(x.name = "D$cens",
            newobj = "EVENT",
            datasources = connections)

  ds.asNumeric(x.name = "D$survtime",
            newobj = "SURVTIME",
            datasources = connections)

  dsSurvivalClient::ds.Surv(time='SURVTIME', event='EVENT', objectname='surv_object')

  dsSurvivalClient::ds.coxph.SLMA(formula = 'surv_object ~  D$female', 
            dataName = 'D', datasources = connections)

  dsSurvivalClient::ds.survfit(formula='surv_object~1', objectname='survfit_object')

  dsSurvivalClient::ds.plotsurvfit(formula = 'survfit_object')

  dsSurvivalClient::ds.plotsurvfit(formula = 'survfit_object', fun = 'cloglog')
  
  # clear the Datashield R sessions and logout
  datashield.logout(connections)

## End(Not run)


neelsoumya/dsSurvivalClient documentation built on July 1, 2023, 10:32 p.m.