ds.c {dsBaseClient}R Documentation

Combines values into a vector or list

Description

Concatenates object into one object.

Usage

ds.c(x = NULL, newobj = NULL, datasources = NULL)

Arguments

x

a character, a vector that holds the names of the objects to combine.

newobj

the name of the output object. If this argument is set to NULL, the name of the new object is 'newObject'.

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

To avoid combining the character names and not the vectors on the client side, the names are coerce into a list and the server side function loops through that list to concatenate the list's elements into a vector.

Value

nothing is returned to the client, the new object is stored on the server side.

Author(s)

Gaye, A.

Examples

{

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

  # login and assign specific variable(s)
  # (by default the assigned dataset is a dataframe named 'D')
  myvar <- c('LAB_TSC', 'LAB_HDL')
  opals <- datashield.login(logins=logindata,assign=TRUE,variables=myvar)

  # Get the variables 'LAB_TSC' by 'LAB_HDL' from the dataframe 'D' and combine them
  myvect <- c('D$LAB_TSC', 'D$LAB_HDL')
  ds.assign(toAssign='D$LAB_TSC', newobj='labtsc')
  ds.assign(toAssign='D$LAB_HDL', newobj='labhdl')
  myvect <- c('labtsc', 'labhdl')
  ds.c(x=myvect)

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

}

[Package dsBaseClient version 4.1.0 ]