ds.rm {dsBaseClient}R Documentation

Deletes server-side R objects


deletes R objects on the server-side


ds.rm(x.names = NULL, datasources = NULL)



a character string specifying the objects to be deleted.


a list of DSConnection-class objects obtained after login. If the datasources argument is not specified the default set of connections will be used: see datashield.connections_default.


This function is similar to the native R function rm().

The fact that it is an aggregate function may be surprising because it modifies an object on the server-side, and would, therefore, be expected to be an assign function. However, as an assign function the last step in running it would be to write the modified object as newobj. But this would fail because the effect of the function is to delete the object and so it would be impossible to write it anywhere. Please note that although this calls an aggregate function there is no type argument.

Server function called: rmDS


The ds.rm function deletes from the server-side the specified object. If this is successful the message "Object(s) '<x.names>' was deleted." is returned to the client-side.


DataSHIELD Development Team


## Not run: 

 ## Version 6, for version 5 see the Wiki
  # connecting to the Opal servers


  builder <- DSI::newDSLoginBuilder()
  builder$append(server = "study1", 
                 url = "", 
                 user = "administrator", password = "datashield_test&", 
                 table = "CNSIM.CNSIM1", driver = "OpalDriver")
  builder$append(server = "study2", 
                 url = "", 
                 user = "administrator", password = "datashield_test&", 
                 table = "CNSIM.CNSIM2", driver = "OpalDriver")
  builder$append(server = "study3",
                 url = "", 
                 user = "administrator", password = "datashield_test&", 
                 table = "CNSIM.CNSIM3", driver = "OpalDriver")
  logindata <- builder$build()
  connections <- DSI::datashield.login(logins = logindata, assign = TRUE, symbol = "D") 
  #Create an object in the server-side
  ds.assign(toAssign = "D$LAB_TSC",
            newobj = "labtsc",
            datasources = connections)
  #Delete "labtsc" object from the server-side
  ds.rm(x.names = "labtsc",
        datasources = connections)
  # clear the Datashield R sessions and logout

## End(Not run)

[Package dsBaseClient version 6.3.0 ]