ds.ls {dsBaseClient}R Documentation

Returns a vector of character strings giving the names of the objects on remote server

Description

this function is similar to R function ls

Usage

ds.ls(datasources = NULL)

Arguments

datasources

a list of opal object(s) obtained after login in to opal servers; these objects hold also the data assign to R, as dataframe, from opal datasources.

Details

When running analyses one may want to know the objects already generated. This function is not disclosive as it only returns the names of the objects and not their contents. As a restriction only objects in the current environment can be displayed and hidden objects names (names starting with '.') cannot be returned to avoid displaying anything else than the objects generated by the user in the current environment. Unlike the R base version of this function, the DataSHIELD version does not allow to specify another environment, only names of objects on the 'current' environment can be displayed.

Value

a vector of character strings giving the names of the objects in the 'current' environment of the remote opal server.

Author(s)

Gaye, A.

Examples

{

  # load the file that contains the login details
  data(logindata)

  # login and assign the required variables to R
  myvar <- list("LAB_TSC")
  opals <- datashield.login(logins=logindata,assign=TRUE,variables=myvar)

  # assign 'LAB_TSC' in the dataframe D to a new variable 'labtsc'
  ds.assign(toAssign='D$LAB_TSC', newobj='labtsc')

  # now call the ds.ls function to display the names of the objects on the server site
  ds.ls()

  # clear the Datashield R sessions and logout
  datashield.logout(opals)

}

[Package dsBaseClient version 4.1.0 ]