This tutorial illustrates how to login to two datashield example servers and assign data for use in other tutorials.
library(DSI)
library(DSMolgenisArmadillo)
library(DSOpal)
armadillo_url <- "https://armadillo-playground.molgenis.net/"
token <- armadillo.get_token(armadillo_url)
## [1] "We're opening a browser so you can log in with code MRH4NR"
A browser page will open, press the 'submit' button. On the next screen, enter the below details and press 'submit'.
Credential | Value |
---|---|
User | dsuser@datashield.org |
Password | P@ssw0rd |
When you see the message 'Successfully connected device' you can close the browser window and 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, assign = FALSE)
##
## Logging into the collaborating servers
##
[-------------------------------------------------------------------------------------] 0% / 0s
Login server1 [=======================>------------------------------------------------] 33% / 0s
Login server2 [===============================================>------------------------] 67% / 2s
Logged in all servers [================================================================] 100% / 3s
The tutorials in this wiki make use of three test datasets: mtcars
, titanic
, and iris
. We need to assign these three datasets so that the data is available for analysis. Because Armadillo and Opal
use different storage systems, the path of these tables is different:
datashield.assign.table(conns["server1"], "mtcars", "example-datasets/mtcars/mtcars")
##
[-------------------------------------------------------------------------------------] 0% / 0s
Checking server1 (mtcars <- `example-datasets/mtcars/mtcars`) [------------------------] 0% / 0s
Waiting... (mtcars <- ...) [----------------------------------------------------------] 0% / 0s
Checking server1 (mtcars <- `example-datasets/mtcars/mtcars`) [------------------------] 0% / 0s
Waiting... (mtcars <- ...) [----------------------------------------------------------] 0% / 0s
Checking server1 (mtcars <- `example-datasets/mtcars/mtcars`) [------------------------] 0% / 0s
Waiting... (mtcars <- ...) [----------------------------------------------------------] 0% / 0s
Checking server1 (mtcars <- `example-datasets/mtcars/mtcars`) [------------------------] 0% / 0s
Finalizing assignment server1 (mtcars <- `example-datasets/mtcars/mtcars`) [=====>-----] 50% / 0s
Assigned all table (mtcars <- ...) [===================================================] 100% / 1s
datashield.assign.table(conns["server1"], "titanic", "example-datasets/titanic_train/titanic_train")
##
[-------------------------------------------------------------------------------------] 0% / 0s
Checking server1 (titanic <- `example-datasets/titanic_train/titanic_train`) [---------] 0% / 0s
Finalizing assignment server1 (titanic <- `example-datasets/titanic_train/titanic_train`) [] 5...
Assigned all table (titanic <- ...) [==================================================] 100% / 0s
datashield.assign.table(conns["server1"], "iris", "example-datasets/iris/iris")
##
[-------------------------------------------------------------------------------------] 0% / 0s
Checking server1 (iris <- `example-datasets/iris/iris`) [------------------------------] 0% / 0s
Finalizing assignment server1 (iris <- `example-datasets/iris/iris`) [=======>---------] 50% / 0s
Assigned all table (iris <- ...) [=====================================================] 100% / 0s
datashield.assign.table(conns["server2"], "mtcars", "example-datasets.mtcars")
##
[-------------------------------------------------------------------------------------] 0% / 0s
Checking server2 (mtcars <- `example-datasets.mtcars`) [-------------------------------] 0% / 0s
Waiting... (mtcars <- ...) [----------------------------------------------------------] 0% / 0s
Checking server2 (mtcars <- `example-datasets.mtcars`) [-------------------------------] 0% / 0s
Finalizing assignment server2 (mtcars <- `example-datasets.mtcars`) [========>---------] 50% / 0s
Assigned all table (mtcars <- ...) [===================================================] 100% / 0s
datashield.assign.table(conns["server2"], "titanic", "example-datasets.titanic_train")
##
[-------------------------------------------------------------------------------------] 0% / 0s
Checking server2 (titanic <- `example-datasets.titanic_train`) [-----------------------] 0% / 0s
Waiting... (titanic <- ...) [---------------------------------------------------------] 0% / 0s
Checking server2 (titanic <- `example-datasets.titanic_train`) [-----------------------] 0% / 0s
Finalizing assignment server2 (titanic <- `example-datasets.titanic_train`) [====>-----] 50% / 0s
Assigned all table (titanic <- ...) [==================================================] 100% / 0s
datashield.assign.table(conns["server2"], "iris", "example-datasets.iris")
##
[-------------------------------------------------------------------------------------] 0% / 0s
Checking server2 (iris <- `example-datasets.iris`) [-----------------------------------] 0% / 0s
Waiting... (iris <- ...) [------------------------------------------------------------] 0% / 0s
Checking server2 (iris <- `example-datasets.iris`) [-----------------------------------] 0% / 0s
Waiting... (iris <- ...) [------------------------------------------------------------] 0% / 0s
Checking server2 (iris <- `example-datasets.iris`) [-----------------------------------] 0% / 0s
Waiting... (iris <- ...) [------------------------------------------------------------] 0% / 0s
Checking server2 (iris <- `example-datasets.iris`) [-----------------------------------] 0% / 0s
Finalizing assignment server2 (iris <- `example-datasets.iris`) [==========>-----------] 50% / 0s
Assigned all table (iris <- ...) [=====================================================] 100% / 0s