Skip to content

Install client and server packages in RStudio

Sido Haakma edited this page Dec 24, 2018 · 4 revisions

You can both maintain client and server packages in RStudio.

Prepare development environment

You need a devtools package to install sources from github in RStudio.

# install the development tools for RStudio
install.packages("devtools")

DataSHIELD client packages (RStudio for instance)

You can use install_github("datashield/dsBetaTestClient") to upgrade. You do not need to remove the package.

DataSHIELD server packages (Opal RServer)

You can install the packages client-side on the opal instance (check https://cran.obiba.org/web/opaladmin/). You have to login as administrator on Opal in RStudio. So use the same credentials as you login to the Opal webinterface.

Allright so the code snippets that I used are:

# load opaladmin package
library("opaladmin")

# setup credential object
server <- c("opal")
url <- c("https://opal.test.molgenis.org")
username <- c("user")
password <- c("password")
logindata <- data.frame(server,url,username,password)
#logout just in case
datashield.logout(opals)
#log in
opals <- datashield.login(logins=logindata,assign=TRUE)

# install serverside package
dsadmin.install_package(opals, 'dsBetaTest', githubusername='datashield', ref = 'master')

You can also use other refs. You need to quote all parameters except the "opals" object. You can check the version of the package in https://opal.test.molgenis.org Administration --> DataSHIELD. You can also upgrade the package without delete them on the serverside.