ds.cbind {dsBaseClient}R Documentation

Combines objects by columns


This is similar to the R base function cbind with the only differences that it allows to combine up to 5 objects (vectors and/or table structures).


ds.cbind(x = NULL, newobj = "newCbindObject", datasources = NULL)



a character vector, the name of the vector and or table to combine by column.


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


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.


see details of the R base function cbind.


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


Gaye, A.

See Also

ds.dataframe to generate a table of type dataframe.

ds.changeRefGroup to change the reference level of a factor.

ds.colnames to obtain the column names of a matrix or a data frame

ds.asMatrix to coerce an object into a matrix type.

ds.dim to obtain the dimensions of matrix or a data frame.



  # load the file that contains the login details

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

  # generate a new dataframe by combining the log values of
  # 'LAB_TSC' and 'LAB_HDL', by columns
  ds.assign(toAssign='log(D$LAB_TSC)', newobj='labtsc')
  ds.assign(toAssign='log(D$LAB_HDL)', newobj='labhdl')
  ds.cbind(x=c('labtsc','labhdl'), newobj="myDataframe")

  # clear the Datashield R sessions and logout


[Package dsBaseClient version 4.1.0 ]