ds.DANGERc2sMATDF {dsDangerClient}R Documentation

DANGER FUNCTION copying clientside matrix to serverside

Description

Creates a matrix A on the serverside from matrix A on the clientside

Usage

ds.DANGERc2sMATDF(
  mdata = NA,
  dimnames = NULL,
  newobj = NULL,
  datasources = NULL
)

Arguments

mdata

is a character string that specifies the name of the matrix or data.frame to be copied from the clientside to the serverside

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. If NULL (the default) the column names of the original <mdata> data.frame or matrix are taken across to specify the column names of the serverside matrix

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 "new_matrix"

datasources

specifies the particular 'connection object(s)' to use. e.g. if you have several data sets in the sources you are working with called opals.a, opals.w2, and connection.xyz, you can choose which of these to work with. The call 'datashield.connections_find()' lists all of the different datasets available and if one of these is called 'default.connections' that will be the dataset used by default if no other dataset is specified. If you wish to change the connections you wish to use by default the call datashield.connections_default('opals.a') will set 'default.connections' to be 'opals.a' and so in the absence of specific instructions to the contrary (e.g. by specifiying a particular dataset to be used via the <datasources> argument) all subsequent function calls will be to the datasets held in opals.a. If the <datasources> argument is specified, it should be set without inverted commas: e.g. datasources=opals.a or datasources=default.connections. The <datasources> argument also allows you to apply a function solely to a subset of the studies/sources you are working with. For example, the second source in a set of three, can be specified using a call such as datasources=connection.xyz[2]. On the other hand, if you wish to specify solely the first and third sources, the appropriate call will be datasources=connections.xyz[c(1,3)]

Details

ds.DANGERc2sMATDF calling assign function DANGERc2sMATDFDS. This is a DANGER FUNCTION because it gives the clientside analyst a lot of power to create a data structure that is precise and complex on the severside. In fact this may be absolutely fine - the general rule is that concerns about disclosure relate entirely to aggregate functions rather than assign functions. However, for the moment this wil be kept as a DANGER FUNCTION and could later be considered for conversion to a standard function, if requested. This DANGER function was created from the ds.matrix function. A number of the parameters specifying the matrix to be generated are fixed by the nature of the clientside matrix itself rather than by explicitly stating them as arguments. In consequence, they have been removed from the list of arguments and are instead given invariant values in the first few lines of code. These include: from<-"clientside.matdf", nrows.scalar=NULL, ncols.scalar=NULL, byrow = FALSE. The <from> argument was originally a character string specifying the source and nature of <mdata>. Because this DANGER function is only intended to copy a clientside matrix or data.frame to the serverside, its value is fixed to "clientside.matdf". The <nrows.scalar> and <ncols.scalar> are fixed empirically by the number of rows and columns of the matrix to be transferred. <byrow> specifies writing the serverside matrix by columns or rows and this is always set as by column (i.e. FALSE).

Value

the object specified by the <newobj> argument (or default name "new_matrix") which is written as a data.frame 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.

Author(s)

Paul Burton for DataSHIELD Development Team


[Package dsDangerClient version 6.2.0 ]