View source: R/ds.plotsurvfit.R
ds.plotsurvfit | R Documentation |
Performs plotting of privacy preserving survival curves.
ds.plotsurvfit(
formula = NULL,
dataName = NULL,
fun = NULL,
datasources = NULL,
xlab = "",
ylab = "",
ggplot = FALSE
)
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 |
xlab |
X-axis label, a character string. Default value is ”. |
ylab |
Y-axis label, a character string. Default value is ”. |
This is a server-side function that plots privacy preserving survival curves in DataSHIELD.
Server function called: plotsurvfitDS
.
privacy preserving survival curve from the server side environment.
Soumya Banerjee, Demetris Avraam, Paul Burton, Xavier Escriba-Montagut, Juan Gonzalez and Tom RP Bishop (2022).
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.