ds.dim {dsBaseClient}R Documentation

Retrieves the dimension of an object


this function is similar to R function dim


ds.dim(x = NULL, type = "split", datasources = NULL)



a character, the name of R table object, for example a matrix, array or data frame


a character which represents the type of analysis to carry out. If type is set to 'combine', a global variance is calculated .


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.


the function returns the unpooled or pooled dimension of the object by summing up the individual dimensions returned from each study or the dimension of the object in each study. Unlike the other DataSHIELD function the default behaviour is to output the dimension of each study separately.


for an array, NULL or a vector of mode integer


Gaye, A.; Isaeva, J.

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.length to obtain the size of a vector.



  # load that contains the login details

  # login and assign all the stored variables.
  opals <- datashield.login(logins=logindata,assign=TRUE)

  # Example 1: Get the dimension of the assigned datasets in each study

  # Example 2: Get the pooled dimension of the assigned datasets
  ds.dim(x='D', type='combine')

  # Example 2: Input has to be either matrix, data frame or an array
  # In the below example, the inpout is a vector so it will not work.
  ## Not run:  ds.dim(x='D$LAB_TSC') 

  # clear the Datashield R sessions and logout


[Package dsBaseClient version 4.1.0 ]