This tutorial illustrates how to log in to two DataSHIELD example servers and assign data for use in other tutorials.
library(DSOpal)
library(DSMolgenisArmadillo)
For Armadillo you need to fetch the access token:
armadillo_url <- "https://armadillo-playground.molgenis.net/"
token <- MolgenisArmadillo::armadillo.get_token(armadillo_url)
## [1] "We're opening a browser so you can log in with code FTTW-TFGS"
A browser page will open. Press the Submit button. Then enter:
| Credential | Value |
|---|---|
| User | dsuser@datashield.org |
| Password | P@ssw0rd |
Once you see "Successfully connected device", you can return to RStudio.
builder <- DSI::newDSLoginBuilder()
builder$append(
server = "server1",
url = "https://armadillo-playground.molgenis.net/",
token = token,
driver = "ArmadilloDriver"
)
builder$append(
server = "server2",
url = "https://opal-demo.obiba.org/",
user = "dsuser",
password = "P@ssw0rd",
driver = "OpalDriver"
)
logindata <- builder$build()
conns <- datashield.login(logins = logindata)
Now we assign some test datasets by specifying the table name that applies to each server:
# CNSIM
datashield.assign.table(conns, "cnsim", list(
server1="example-datasets/data/cnsim_1",
server2="CNSIM.CNSIM2"))
# DASIM
datashield.assign.table(conns, "dasim", list(
server1="example-datasets/data/dasim_1",
server2="DASIM.DASIM2"))
# depression
datashield.assign.table(conns, "depression", list(
server1="example-datasets/data/depression_1",
server2="depression.growth_2"))
# SURVIVAL
datashield.assign.table(conns, "survival", list(
server1="example-datasets/data/survival_1",
server2="SURVIVAL.EXPAND_WITH_MISSING2"))
# TITANIC
datashield.assign.table(conns, "titanic", list(
server1="example-datasets/data/titanic_1",
server2="TITANIC_NEWCOMERS_WORKSHOP.titanic_server_2"))