R Client
It is assumed you installed the vantage6-client. The R is can create tasks and retrieve their results. If you want to do more administrative tasks, either use the API directly or use the Python client.
Initialization of the R client can be done by:
1
setup.client <- function() {
2
# Username/password should be provided by the administrator of
3
# the server.
4
username <- "[email protected]"
5
password <- "password"
6
7
host <- 'https://petronas.vantage6.ai'
8
api_path <- ''
9
10
# Create the client & authenticate
11
client <- vtg::Client$new(host, api_path=api_path)
12
client$authenticate(username, password)
13
14
return(client)
15
}
16
17
# Create a client
18
client <- setup.client()
Copied!
Then this client can be used for the different algorithms. Refer to the README in the repository on how to call the algorithm. Usually this includes installing some additional client-side packages for the specific algorithm you are using.
The R client is subject to change. We aim to make it more similar to the Python client.

Example

First you need to install the client side of the algorithm by:
1
devtools::install_github('iknl/vtg.coxph', subdir="src")
Copied!
This is the code to run the coxph:
1
print( client$getCollaborations() )
2
3
# Should output something like this:
4
# id name
5
# 1 1 ZEPPELIN
6
# 2 2 PIPELINE
7
8
# Select a collaboration
9
client$setCollaborationId(1)
10
11
# Define explanatory variables, time column and censor column
12
expl_vars <- c("Age","Race2","Race3","Mar2","Mar3","Mar4","Mar5","Mar9",
13
"Hist8520","hist8522","hist8480","hist8501","hist8201",
14
"hist8211","grade","ts","nne","npn","er2","er4")
15
time_col <- "Time"
16
censor_col <- "Censor"
17
18
# vtg.coxph contains the function `dcoxph`.
19
result <- vtg.coxph::dcoxph(client, expl_vars, time_col, censor_col)
Copied!
Last modified 29d ago
Export as PDF
Copy link
Contents
Example