if (FALSE) {
#### The below examples illustrate an analysises that use test/simulated data ####
# build your data.frame
builder <- newDSLoginBuilder()
builder$append(server="server1", url="https://opal-demo.obiba.org",
table="datashield.CNSIM1", resource="datashield.CNSIM1r",
user="dsuser", password="password",
options="list(ssl_verifyhost=0,ssl_verifypeer=0)")
builder$append(server="server2", url="dslite.server",
table="CNSIM2", resource="CNSIM2r", driver="DSLiteDriver")
builder$append(server="server3", url="https://molgenis.example.org",
table="CNSIM3", resource="CNSIM3r", token="123456789", driver="MolgenisDriver")
builder$append(server="server4", url="dslite.server",
table="CNSIM4", resource="CNSIM4r", driver="DSLiteDriver")
logindata <- builder$build()
# or load the data.frame that contains the login details
data(logindata)
# Example 1: just login (default)
connections <- datashield.login(logins=logindata)
# Example 2: login and assign the whole dataset
connections <- datashield.login(logins=logindata, assign=TRUE)
# Example 3: login and assign specific variable(s)
myvar <- list("LAB_TSC")
connections <- datashield.login(logins=logindata, assign=TRUE, variables=myvar)
# Example 4: ignore with a warning message servers for which connection cannot be established
connections <- datashield.login(logins=logindata, failSafe=TRUE)
# note that the asignment information can also be provided afterwards
builder <- newDSLoginBuilder()
builder$append(server="server1", url="https://opal-demo.obiba.org",
user="dsuser", password="password")
builder$append(server="server2", url="https://opal-test.obiba.org",
token="123456789")
logindata <- builder$build()
connections <- datashield.login(logins=logindata)
datashield.assign.table(connections, symbol = "D",
table = list(server1 = "CNSIM.CNSIM1",
server2 = "CNSIM.CNSIM2"))
datashield.assign.resource(connections, symbol = "rsrc",
resource = list(server1 = "res.CNSIM1",
server2 = "res.CNSIM2"))
}
Run the code above in your browser using DataLab