-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathds_direct.r
More file actions
41 lines (32 loc) · 1.26 KB
/
Copy pathds_direct.r
File metadata and controls
41 lines (32 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Load opal and datashield libraries
library(opal)
library(opaladmin)
library(dsBaseClient)
library(dsStatsClient)
library(dsGraphicsClient)
library(dsModellingClient)
# Login to VMs
# To understand why these variables are assigned this way, see the
# documentation for the datashield.login function (part of the opal
# package)
# login details
begin = as.numeric(Sys.time())
server <- c("datashield_opal")
# note the datashield_opal only works from inside this docker container
#url <- c("http://localhost:8880")
url <- c("https://localhost:8843")
# ^^^ Note this specifies the port number
user <- "test"
password <- "test123"
table <- c("test.LifeLines")
# ^^^ note that this reflects the folder hierarchy that can be seen via the OPAL web interface
# Create a dataframe with all these details
logindata <- data.frame(server,url,user,password,table)
# Create an 'opals' object by passing the 'logindata' data frame to the
# datashield.login function
opals <- datashield.login(logins=logindata, assign = TRUE)
ds.glm(formula='D$SMK31~D$GESLACHT+D$LENGTE', family='binomial', datasources = opals)
datashield.logout(opals)
timeTaken = as.numeric(Sys.time()) - begin
print(paste(c("time taken = ", timeTaken)))
print("Congratualations!!! - a basic glm model was successfully generated")