Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
46 changes: 23 additions & 23 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Generated by roxygen2: do not edit by hand

export(BooleDS)
export(absDS)
export(asCharacterDS)
export(asDataMatrixDS)
export(asFactorDS1)
export(asFactorDS2)
export(asFactor1DS)
export(asFactor2DS)
export(asFactorSimpleDS)
export(asIntegerDS)
export(asListDS)
export(asLogicalDS)
export(asMatrixDS)
export(asNumericDS)
export(aucDS)
export(booleDS)
export(boxPlotGGDS)
export(boxPlotGG_data_TreatmentDS)
export(boxPlotGG_data_Treatment_numericDS)
Expand All @@ -30,8 +30,8 @@ export(corTestDS)
export(covDS)
export(dataFrameDS)
export(dataFrameSortDS)
export(dataFrameSubsetDS1)
export(dataFrameSubsetDS2)
export(dataFrameSubset1DS)
export(dataFrameSubset2DS)
export(densityGridDS)
export(dimDS)
export(dmtC2SDS)
Expand All @@ -44,41 +44,41 @@ export(gamlssDS)
export(getAllLevelsDS)
export(getClassAllColsDS)
export(getWGSRDS)
export(glmDS1)
export(glmDS2)
export(glm1DS)
export(glm2DS)
export(glmPredictDS.ag)
export(glmPredictDS.as)
export(glmSLMA1DS)
export(glmSLMA2DS)
export(glmSLMADS.assign)
export(glmSLMADS1)
export(glmSLMADS2)
export(glmSummaryDS.ag)
export(glmSummaryDS.as)
export(glmerSLMA2DS)
export(glmerSLMADS.assign)
export(glmerSLMADS2)
export(heatmapPlotDS)
export(hetcorDS)
export(histogramDS1)
export(histogramDS2)
export(histogram1DS)
export(histogram2DS)
export(igb_standardsDS)
export(isNaDS)
export(isValidDS)
export(kurtosisDS1)
export(kurtosisDS2)
export(kurtosis1DS)
export(kurtosis2DS)
export(lengthDS)
export(levelsDS)
export(lexisDS1)
export(lexisDS2)
export(lexisDS3)
export(lexis1DS)
export(lexis2DS)
export(lexis3DS)
export(listDS)
export(listDisclosureSettingsDS)
export(lmerSLMA2DS)
export(lmerSLMADS.assign)
export(lmerSLMADS2)
export(logDS)
export(lsDS)
export(lsplineDS)
export(matrixDS)
export(matrixDetDS1)
export(matrixDetDS2)
export(matrixDet1DS)
export(matrixDet2DS)
export(matrixDiagDS)
export(matrixDimnamesDS)
export(matrixInvertDS)
Expand Down Expand Up @@ -111,13 +111,13 @@ export(sampleDS)
export(scatterPlotDS)
export(seqDS)
export(setSeedDS)
export(skewnessDS1)
export(skewnessDS2)
export(skewness1DS)
export(skewness2DS)
export(sqrtDS)
export(table1DDS)
export(table2DS)
export(tableDS)
export(tableDS.assign)
export(tableDS2)
export(tapplyDS)
export(tapplyDS.assign)
export(unListDS)
Expand Down
4 changes: 2 additions & 2 deletions R/asFactorDS1.R → R/asFactor1DS.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' @export
#'
asFactorDS1 <- function(input.var.name=NULL){
asFactor1DS <- function(input.var.name=NULL){
##################################################################
#MODULE 1: CAPTURE THE nfilter SETTINGS #
thr<-dsBase::listDisclosureSettingsDS() #
Expand Down Expand Up @@ -49,5 +49,5 @@ asFactorDS1 <- function(input.var.name=NULL){

}
#AGGREGATE FUNCTION
# asFactorDS1
# asFactor1DS

4 changes: 2 additions & 2 deletions R/asFactorDS2.R → R/asFactor2DS.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' @export
#'
asFactorDS2 <- function(input.var.name=NULL, all.unique.levels.transmit=NULL, fixed.dummy.vars=NULL, baseline.level=NULL){
asFactor2DS <- function(input.var.name=NULL, all.unique.levels.transmit=NULL, fixed.dummy.vars=NULL, baseline.level=NULL){

input.var <- .loadServersideObject(input.var.name)

Expand Down Expand Up @@ -48,4 +48,4 @@ asFactorDS2 <- function(input.var.name=NULL, all.unique.levels.transmit=NULL, fi

}
#ASSIGN FUNCTION
# asFactorDS2
# asFactor2DS
4 changes: 2 additions & 2 deletions R/BooleDS.R → R/booleDS.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#'
#' @title BooleDS
#' @title booleDS
#' @description Converts the individual elements of a vector or other object into
#' Boolean indicators.
#' @details The function converts the input vector into Boolean indicators.
Expand All @@ -26,7 +26,7 @@
#' @return the levels of the input variable.
#' @export
#'
BooleDS <- function(V1.name=NULL, V2.name=NULL, Boolean.operator.n=NULL, na.assign.text, numeric.output=TRUE){
booleDS <- function(V1.name=NULL, V2.name=NULL, Boolean.operator.n=NULL, na.assign.text, numeric.output=TRUE){

# Check Permissive Privacy Control Level.
dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana', 'carrot'))
Expand Down
24 changes: 12 additions & 12 deletions R/dataFrameSubsetDS1.R → R/dataFrameSubset1DS.R
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
#'
#' @title dataFrameSubsetDS1 an aggregate function called by ds.dataFrameSubset
#' @title dataFrameSubset1DS an aggregate function called by ds.dataFrameSubset
#' @description First serverside function for subsetting a data frame by row or by column.
#' @details A data frame is a list of variables all with the same number of rows,
#' which is of class 'data.frame'. For all details see the help header for ds.dataFrameSubset
#' @param df.name a character string providing the name for the data.frame
#' to be sorted. <df.name> argument generated and passed directly to
#' dataFrameSubsetDS1 by ds.dataFrameSubset
#' dataFrameSubset1DS by ds.dataFrameSubset
#' @param V1.name A character string specifying the name of a subsetting vector
#' to which a Boolean operator will be applied to define the subset to be created.
#' <V1.name> argument generated and passed directly to
#' dataFrameSubsetDS1 by ds.dataFrameSubset
#' dataFrameSubset1DS by ds.dataFrameSubset
#' @param V2.name A character string specifying the name of the vector
#' or scalar to which the values in the vector specified by the argument <V1.name>
#' is to be compared.
#' <V2.name> argument generated and passed directly to
#' dataFrameSubsetDS1 by ds.dataFrameSubset
#' dataFrameSubset1DS by ds.dataFrameSubset
#' @param Boolean.operator.n A character string specifying one of six possible Boolean operators:
#' '==', '!=', '>', '>=', '<', '<='
#' <Boolean.operator.n> argument generated and passed directly to
#' dataFrameSubsetDS1 by ds.dataFrameSubset
#' dataFrameSubset1DS by ds.dataFrameSubset
#' @param keep.cols a numeric vector specifying the numbers of the columns to be kept in the
#' final subset when subsetting by column. For example: keep.cols=c(2:5,7,12) will keep
#' columns 2,3,4,5,7 and 12.
#' <keep.cols> argument generated and passed directly to
#' dataFrameSubsetDS1 by ds.dataFrameSubset
#' dataFrameSubset1DS by ds.dataFrameSubset
#' @param rm.cols a numeric vector specifying the numbers of the columns to be removed before
#' creating the final subset when subsetting by column. For example: rm.cols=c(2:5,7,12)
#' will remove columns 2,3,4,5,7 and 12.
#' <rm.cols> argument generated and passed directly to
#' dataFrameSubsetDS1 by ds.dataFrameSubset
#' dataFrameSubset1DS by ds.dataFrameSubset
#' @param keep.NAs logical, if TRUE any NAs in the vector holding the final Boolean vector
#' indicating whether a given row should be included in the subset will be converted into
#' 1s and so they will be included in the subset. Such NAs could be caused by NAs in
#' either <V1.name> or <V2.name>. If FALSE or NULL NAs in the final Boolean vector will
#' be converted to 0s and the corresponding row will therefore be excluded from the subset.
#' <keep.NAs> argument generated and passed directly to
#' dataFrameSubsetDS1 by ds.dataFrameSubset
#' dataFrameSubset1DS by ds.dataFrameSubset
#' @return This first serverside function called by ds.dataFrameSubset provides
#' first level traps for a comprehensive series of disclosure risks which can be
#' returned directly to the clientside because dataFrameSubsetDS1 is an aggregate
#' returned directly to the clientside because dataFrameSubset1DS is an aggregate
#' function. The second serverside function called by ds.dataFrameSubset
#' (dataFrameSubsetDS2) carries out most of the same disclosure tests, but it is
#' (dataFrameSubset2DS) carries out most of the same disclosure tests, but it is
#' an assign function because it writes the subsetted data.frame to the serverside.
#' In consequence, it records error messages as studysideMessages which can only be
#' retrieved using ds.message
#' @author Paul Burton
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' @export
#'
dataFrameSubsetDS1 <- function(df.name=NULL,V1.name=NULL,V2.name=NULL,Boolean.operator.n=NULL,keep.cols=NULL,rm.cols=NULL,keep.NAs=NULL){
dataFrameSubset1DS <- function(df.name=NULL,V1.name=NULL,V2.name=NULL,Boolean.operator.n=NULL,keep.cols=NULL,rm.cols=NULL,keep.NAs=NULL){

# Check Permissive Privacy Control Level.
dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana', 'carrot'))
Expand Down Expand Up @@ -303,4 +303,4 @@ if(sum(is.na(keep.code.n))>0){

}
# AGGREGATE FUNCTION
# dataFrameSubsetDS1
# dataFrameSubset1DS
25 changes: 12 additions & 13 deletions R/dataFrameSubsetDS2.R → R/dataFrameSubset2DS.R
Original file line number Diff line number Diff line change
@@ -1,50 +1,49 @@
###############################################################################|###################| 80 and 100

#' @title dataFrameSubsetDS2 an assign function called by ds.dataFrameSubset
#'
#' @title dataFrameSubset2DS an assign function called by ds.dataFrameSubset
#' @description Second serverside function for subsetting a data frame by row or by column.
#' @details A data frame is a list of variables all with the same number of rows,
#' which is of class 'data.frame'. For all details see the help header for ds.dataFrameSubset
#' @param df.name a character string providing the name for the data.frame
#' to be sorted. <df.name> argument generated and passed directly to
#' dataFrameSubsetDS2 by ds.dataFrameSubset
#' dataFrameSubset2DS by ds.dataFrameSubset
#' @param V1.name A character string specifying the name of a subsetting vector
#' to which a Boolean operator will be applied to define the subset to be created.
#' <V1.name> argument generated and passed directly to
#' dataFrameSubsetDS2 by ds.dataFrameSubset
#' dataFrameSubset2DS by ds.dataFrameSubset
#' @param V2.name A character string specifying the name of the vector
#' or scalar to which the values in the vector specified by the argument <V1.name>
#' is to be compared.
#' <V2.name> argument generated and passed directly to
#' dataFrameSubsetDS2 by ds.dataFrameSubset
#' dataFrameSubset2DS by ds.dataFrameSubset
#' @param Boolean.operator.n A character string specifying one of six possible Boolean operators:
#' '==', '!=', '>', '>=', '<', '<='
#' <Boolean.operator.n> argument generated and passed directly to
#' dataFrameSubsetDS2 by ds.dataFrameSubset
#' dataFrameSubset2DS by ds.dataFrameSubset
#' @param keep.cols a numeric vector specifying the numbers of the columns to be kept in the
#' final subset when subsetting by column. For example: keep.cols=c(2:5,7,12) will keep
#' columns 2,3,4,5,7 and 12.
#' <keep.cols> argument generated and passed directly to
#' dataFrameSubsetDS2 by ds.dataFrameSubset
#' dataFrameSubset2DS by ds.dataFrameSubset
#' @param rm.cols a numeric vector specifying the numbers of the columns to be removed before
#' creating the final subset when subsetting by column. For example: rm.cols=c(2:5,7,12)
#' will remove columns 2,3,4,5,7 and 12.
#' <rm.cols> argument generated and passed directly to
#' dataFrameSubsetDS2 by ds.dataFrameSubset
#' dataFrameSubset2DS by ds.dataFrameSubset
#' @param keep.NAs logical, if TRUE any NAs in the vector holding the final Boolean vector
#' indicating whether a given row should be included in the subset will be converted into
#' 1s and so they will be included in the subset. Such NAs could be caused by NAs in
#' either <V1.name> or <V2.name>. If FALSE or NULL NAs in the final Boolean vector will
#' be converted to 0s and the corresponding row will therefore be excluded from the subset.
#' <keep.NAs> argument generated and passed directly to
#' dataFrameSubsetDS2 by ds.dataFrameSubset
#' dataFrameSubset2DS by ds.dataFrameSubset
#' @return the object specified by the <newobj> argument (or default name '<df.name>_subset')
#' initially specified in calling ds.dataFrameSubset. The output object (the required
#' subsetted data.frame called <newobj> is written to the serverside. In addition,
#' two validity messages are returned via ds.dataFrameSubset
#' 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 -
#' dataFrameSubsetDS2 (via ds.dataFrame()) also returns any studysideMessages
#' dataFrameSubset2DS (via ds.dataFrame()) 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 \code{ds.message}
Expand All @@ -57,7 +56,7 @@
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' @export
#'
dataFrameSubsetDS2<-function(df.name=NULL,V1.name=NULL, V2.name=NULL, Boolean.operator.n=NULL,keep.cols=NULL, rm.cols=NULL, keep.NAs=NULL){
dataFrameSubset2DS<-function(df.name=NULL,V1.name=NULL, V2.name=NULL, Boolean.operator.n=NULL,keep.cols=NULL, rm.cols=NULL, keep.NAs=NULL){

# Check Permissive Privacy Control Level.
dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana', 'carrot'))
Expand Down Expand Up @@ -327,4 +326,4 @@ return(df.subset)

}
#ASSIGN FUNCTION
# dataFrameSubsetDS2
# dataFrameSubset2DS
14 changes: 7 additions & 7 deletions R/glmDS1.R → R/glm1DS.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#'
#' @title glmDS1 called by ds.glm
#' @title glm1DS called by ds.glm
#' @description This is the first server-side aggregate function called by ds.glm
#' @details It is an
#' aggregation function that sets up the model structure
#' and creates the starting beta.vector that feeds, via ds.glm, into glmDS2 to enable
#' and creates the starting beta.vector that feeds, via ds.glm, into glm2DS to enable
#' iterative fitting of the generalized linear model that has been
#' been specified. For more details please see the extensive header for ds.glm.
#' @param formula a glm() formula consistent with R syntax eg U~x+y+Z to regress
Expand All @@ -22,7 +22,7 @@
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' @export
#'
glmDS1 <- function(formula, family, weights, offset, data){
glm1DS <- function(formula, family, weights, offset, data){


#############################################################
Expand Down Expand Up @@ -202,11 +202,11 @@ if(!is.null(offsetvar))
}
}

#If y, X or w data are invalid, or the model is overparameterized, this will be detected by glmDS1
#If y, X or w data are invalid, or the model is overparameterized, this will be detected by glm1DS
#and passed to ds.glm resulting in a warning and a controlled shut down of the function.
#But in case someone modifies the client side function to circumvent the trap, so the
#error is only apparent once the main main iterations have started via glmDS2
#the equivalent tests in glmDS2 will destroy the info.matrix and score.vector in the affected study so
#error is only apparent once the main main iterations have started via glm2DS
#the equivalent tests in glm2DS will destroy the info.matrix and score.vector in the affected study so
#the model fitting will simply terminate.

if(!(y.invalid>0||w.invalid>0||o.invalid>0||sum(Xpar.invalid)>0||glm.saturation.invalid>0)){
Expand All @@ -221,6 +221,6 @@ if(!is.null(offsetvar))

}
#AGGREGATE FUNCTION
# glmDS1
# glm1DS


14 changes: 7 additions & 7 deletions R/glmDS2.R → R/glm2DS.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#'
#' @title glmDS2 called by ds.glm
#' @title glm2DS called by ds.glm
#' @description This is the second server-side aggregate function called by ds.glm.
#' @details It is an aggregate function that uses the model structure and starting
#' beta.vector constructed by glmDS1 to iteratively fit the generalized linear model
#' that has been specified. The function glmDS2 also carries out a series of disclosure
#' beta.vector constructed by glm1DS to iteratively fit the generalized linear model
#' that has been specified. The function glm2DS also carries out a series of disclosure
#' checks and if the arguments or data fail any of those tests,
#' model construction is blocked and an appropriate serverside error message is
#' created and returned to ds.glm on the clientside.
Expand All @@ -25,7 +25,7 @@
#' @return List with values from GLM model
#' @export
#'
glmDS2 <- function (formula, family, beta.vect, offset, weights, dataName) {
glm2DS <- function (formula, family, beta.vect, offset, weights, dataName) {

#############################################################
#MODULE 1: CAPTURE THE nfilter SETTINGS
Expand Down Expand Up @@ -266,7 +266,7 @@ glmDS2 <- function (formula, family, beta.vect, offset, weights, dataName) {
#score.vector and information.matrix in the study with the problem.
#So this will make model fail without explanation

#Disclosure code from glmDS1
#Disclosure code from glm1DS

errorMessage.combined <- NULL

Expand Down Expand Up @@ -335,7 +335,7 @@ glmDS2 <- function (formula, family, beta.vect, offset, weights, dataName) {
#CHECK W VECTOR VALIDITY
w.invalid <- 0

#Keep same object name as in glmDS1
#Keep same object name as in glm1DS
w.vect <- weightsvar

unique.values.noNA.w <- unique(w.vect[stats::complete.cases(w.vect)])
Expand Down Expand Up @@ -390,4 +390,4 @@ glmDS2 <- function (formula, family, beta.vect, offset, weights, dataName) {

}
# AGGREGATE FUNCTION
# glmDS2
# glm2DS
Loading
Loading