-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add a function to load additional workspaces #16
Labels
enhancement
New feature or request
Comments
Can be easily done, requires the following changes:
Note that the side effect of this operation will be that any previously existing symbol will be overridden by the restored ones having the same name. |
ymarcon
added a commit
that referenced
this issue
Jun 17, 2022
ymarcon
added a commit
to datashield/DSLite
that referenced
this issue
Jun 17, 2022
As a prototype, you can try this feature with DSLite #install.packages("dsBase", repos = c("https://cloud.r-project.org", "https://cran.datashield.org"))
remotes::install_github("datashield/DSI", ref = "workspaces")
remotes::install_github("datashield/DSLite", ref = "workspaces")
library(DSLite)
library(dsBaseClient)
# prepare DSLite server
data("CNSIM1")
data("CNSIM2")
dslite.server <- newDSLiteServer(tables=list(CNSIM1=CNSIM1, CNSIM2=CNSIM2))
builder <- newDSLoginBuilder()
builder$append(server = "study1", url = "dslite.server",
table = "CNSIM1", driver = "DSLiteDriver")
logindata <- builder$build()
conns <- datashield.login(logins = logindata, assign = TRUE)
# save what was assigned at login
datashield.symbols(conns)
datashield.workspace_save(conns, "c1")
# assign a new table
datashield.assign.table(conns, "D2", list(study1 = "CNSIM2"))
datashield.symbols(conns)
# remove first data.frame and save workspace
datashield.rm(conns, "D")
datashield.symbols(conns)
datashield.workspace_save(conns, "c2")
# list saved workspaces
datashield.workspaces(conns)
datashield.logout(conns)
conns <- datashield.login(logins = logindata)
# verify no assignments
datashield.symbols(conns)
# verify available workspaces
datashield.workspaces(conns)
# restore c1
datashield.workspace_restore(conns, "c1")
datashield.symbols(conns)
# restore c2
datashield.workspace_restore(conns, "c2")
datashield.symbols(conns)
# verify data.frames are the ones expected
ds.summary("D")
ds.summary("D2")
# note that lsDS() is broken because it searches symbols in the .GlobalEnv instead of the parent.frame()
ds.ls()
datashield.logout(conns) |
ymarcon
added a commit
to datashield/DSLite
that referenced
this issue
Oct 6, 2022
ymarcon
added a commit
that referenced
this issue
Oct 6, 2022
ymarcon
added a commit
to datashield/DSOpal
that referenced
this issue
Oct 6, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is it a useful to have a "datashield.workspace_restore" function to allow users to restore more than one workspaces (in addition to the restore of a single workspace through the datashield.login(.... restore='xxx') function) and therefore to allow them to combine objects from the different workspaces?
The text was updated successfully, but these errors were encountered: