ds.matrixDimnames {dsBaseClient}R Documentation

ds.matrixDimnames calling assign function matrixDimnamesDS

Description

Adds dimnames (row names, column names or both) to a matrix on the serverside.

Usage

ds.matrixDimnames(M1 = NULL, dimnames = NULL, newobj = NULL,
  datasources = NULL)

Arguments

M1

Specifies the name of the serverside matrix to which dimnames are to be added. Specified as a character string in inverted commas: e.g. M1="matrix.name"

dimnames

A dimnames attribute for the matrix: NULL or a list of length 2 giving the row and column names respectively. An empty list is treated as NULL, and a list of length one as row names only. Components in the list can be specified as character strings (e.g. "a", "name3" or "77"), or numbers (e.g. 1,-8, 1:10). Examples include: dimnames=list(c("a","cc","73",8,"h"),c("1","b","d","8","ghhj",1:4)) specifies the row names and column names for a matrix with 5 rows and 9 columns; dimnames=list(NULL,c("1","b","d","8","ghhj",1:4)) specifies just the column names for a matrix with 9 columns; dimnames=list(c("a","cc","73",8,"h"),NULL) specifies just the row names for a matrix with 5 rows.

newobj

A character string specifying the name of the matrix to which the output is to be written. If no <newobj> argument is specified or it is NULL the output matrix names defaults to "<M1>_dimnames" where <M1> is the matrix name specified by the <M1> argument

datasources

specifies the particular opal object(s) to use. If the <datasources> argument is not specified the default set of opals will be used. The default opals are called default.opals and the default can be set using the function ds.setDefaultOpals. If the <datasources> is to be specified, it should be set without inverted commas: e.g. datasources=opals.em or datasources=default.opals. If you wish to apply the function solely to e.g. the second opal server in a set of three, the argument can be specified as: e.g. datasources=opals.em[2]. If you wish to specify the first and third opal servers in a set you specify: e.g. datasources=opals.em[c(1,3)]

Details

Adds dimnames (row names, column names or both) to a matrix on the serverside. Similar to the dimnames function in native R.

Value

the object specified by the <newobj> argument (or default name "<M1>_dimnames") which is written to the serverside. In addition, two validity messages are returned indicating whether <newobj> has been created in each data source and if so whether it is in a valid form. If its form is not valid in at least one study - e.g. because a disclosure trap was tripped and creation of the full output object was blocked - ds.matrixDimnames also returns any studysideMessages that can explain the error in creating the full output object. As well as appearing on the screen at run time,if you wish to see the relevant studysideMessages at a later date you can use the ds.message function. If you type ds.message("newobj") it will print out the relevant studysideMessage from any datasource in which there was an error in creating <newobj> and a studysideMessage was saved. If there was no error and <newobj> was created without problems no studysideMessage will have been saved and ds.message("newobj") will return the message: "ALL OK: there are no studysideMessage(s) on this datasource".

Author(s)

Paul Burton for DataSHIELD Development Team


[Package dsBaseClient version 5.0.0 ]