Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
51 changes: 51 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:

name: R-CMD-check.yaml

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual", "--as-cran", "--compact-vignettes=gs+qpdf")'
181 changes: 3 additions & 178 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: dsBase
Title: DataSHIELD Server Site Base Functions
Description: Base DataSHIELD functions for the server side. DataSHIELD is a software package which allows
you to do non-disclosive federated analysis on sensitive data. DataSHIELD analytic functions have
Title: 'DataSHIELD' Server Site Base Functions
Description: Base 'DataSHIELD' functions for the server side. 'DataSHIELD' is a software package which allows
you to do non-disclosive federated analysis on sensitive data. 'DataSHIELD' analytic functions have
been designed to only share non disclosive summary statistics, with built in automated output
checking based on statistical disclosure control. With data sites setting the threshold values for
the automated output checks.
Expand Down Expand Up @@ -59,180 +59,5 @@ Imports:
childsds
Suggests:
testthat
AggregateMethods:
asFactorDS1,
asListDS,
aucDS,
boxPlotGGDS,
checkNegValueDS,
classDS,
colnamesDS,
corTestDS,
corDS,
covDS,
dataFrameSubsetDS1,
densityGridDS,
extractQuantilesDS1,
extractQuantilesDS2,
dimDS,
gamlssDS,
glmDS1,
glmDS2,
glmerSLMADS2,
glmPredictDS.ag,
glmSLMADS1,
glmSLMADS2,
glmSummaryDS.ag,
heatmapPlotDS,
hetcorDS,
histogramDS1,
histogramDS2,
isNaDS,
isValidDS,
kurtosisDS1,
kurtosisDS2,
lengthDS,
levelsDS,
lexisDS1,
listDisclosureSettingsDS,
lmerSLMADS2,
lsDS,
matrixDetDS1,
meanDS,
meanSdGpDS,
messageDS,
metadataDS,
miceDS,
minMaxRandDS,
namesDS,
numNaDS,
quantileMeanDS,
rangeDS,
ranksSecureDS1,
ranksSecureDS3,
rmDS,
scatterPlotDS,
scoreVectDS,
setSeedDS,
skewnessDS1,
skewnessDS2,
table1DDS,
table2DDS,
tableDS,
tableDS2,
tapplyDS,
testObjExistsDS,
varDS,
exists=base::exists,
is.character=base::is.character,
is.factor=base::is.factor,
is.list=base::is.list,
is.null=base::is.null,
is.numeric=base::is.numeric,
NROW=base::NROW,
t.test=stats::t.test
AssignMethods:
absDS,
asCharacterDS,
asDataMatrixDS,
asFactorDS2,
asFactorSimpleDS,
asIntegerDS,
asListDS,
asLogicalDS,
asMatrixDS,
asNumericDS,
blackBoxDS,
blackBoxRanksDS,
BooleDS,
boxPlotGG_data_TreatmentDS,
boxPlotGG_data_Treatment_numericDS,
bp_standardsDS,
cbindDS,
cDS,
changeRefGroupDS,
completeCasesDS,
dataFrameDS,
dataFrameFillDS,
dataFrameSortDS,
dataFrameSubsetDS2,
dmtC2SDS,
elsplineDS,
glmerSLMADS.assign,
glmPredictDS.as,
glmSLMADS.assign,
glmSummaryDS.as,
getWGSRDS,
igb_standardsDS,
listDS,
lexisDS2,
lexisDS3,
lmerSLMADS.assign,
lsplineDS,
matrixDetDS2,
matrixDiagDS,
matrixDimnamesDS,
matrixDS,
matrixInvertDS,
matrixMultDS,
matrixTransposeDS,
mergeDS,
nsDS,
qlsplineDS,
ranksSecureDS2,
ranksSecureDS4,
ranksSecureDS5,
rbindDS,
rBinomDS,
recodeLevelsDS,
recodeValuesDS,
repDS,
replaceNaDS,
reShapeDS,
rNormDS,
rowColCalcDS,
rPoisDS,
rUnifDS,
sampleDS,
seqDS,
sqrtDS,
subsetByClassDS,
subsetDS,
tableDS.assign,
tapplyDS.assign,
uniqueDS,
unListDS,
vectorDS,
as.character=base::as.character,
as.null=base::as.null,
as.numeric=base::as.numeric,
attach=base::attach,
c=dsBase::vectorDS,
complete.cases=stats::complete.cases,
list=base::list,
exp=base::exp,
log=base::log,
sqrt=base::sqrt,
abs=base::abs,
sin=base::sin,
cos=base::cos,
tan=base::tan,
asin=base::asin,
acos=base::acos,
atan=base::atan,
sum=base::sum,
unlist=base::unlist
Options:
datashield.privacyLevel=5,
default.datashield.privacyControlLevel="banana",
default.nfilter.glm=0.33,
default.nfilter.kNN=3,
default.nfilter.string=80,
default.nfilter.subset=3,
default.nfilter.stringShort=20,
default.nfilter.tab=3,
default.nfilter.noise=0.25,
default.nfilter.levels.density=0.33,
default.nfilter.levels.max=40
RoxygenNote: 7.3.2
Encoding: UTF-8
6 changes: 4 additions & 2 deletions R/BooleDS.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
#' @param na.assign.text A character string taking values 'NA', '1' or '0'. If 'NA'
#' then any NA values in the
#' input vector remain as NAs in the output vector. If '1' or '0' NA values in the
#' input vector are
#' all converted to 1 or 0 respectively.#' @return the levels of the input variable.
#' input vector are all converted to 1 or 0 respectively.
#'
#' @author DataSHIELD Development Team
#'
#' @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){
Expand Down
10 changes: 4 additions & 6 deletions R/absDS.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,19 @@
#' @param x a string character, the name of a numeric or integer vector
#' @return the object specified by the \code{newobj} argument
#' of \code{ds.abs} (or default name \code{abs.newobj})
#' which is written to the serverside. The output object is of class numeric
#' which is written to the serverside. The output object is of class numeric
#' or integer.
#' @author Demetris Avraam for DataSHIELD Development Team
#' @export
#'
absDS <- function(x){

x.var <- eval(parse(text=x), envir = parent.frame())
absDS <- function(x) {
x.var <- eval(parse(text = x), envir = parent.frame())

# compute the absolute values of x
out <- abs(x.var)

# assign the outcome to the data servers
return(out)

}
# ASSIGN FUNCTION
# absDS
10 changes: 4 additions & 6 deletions R/asCharacterDS.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#'
#'
#' @title Coerces an R object into class character
#' @description this function is based on the native R function \code{as.character}
#' @details See help for function \code{as.character} in native R
Expand All @@ -11,14 +11,12 @@
#' details see help on the clientside function \code{ds.asCharacter}
#' @author Amadou Gaye, Paul Burton, Demetris Avraam for DataSHIELD Development Team
#' @export
#'
asCharacterDS <- function (x.name){

x<-eval(parse(text=x.name), envir = parent.frame())
#'
asCharacterDS <- function(x.name) {
x <- eval(parse(text = x.name), envir = parent.frame())

output <- as.character(x)
return(output)

}
# ASSIGN FUNCTION
# asCharacterDS
16 changes: 7 additions & 9 deletions R/asDataMatrixDS.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@
#' details see help on the clientside function \code{ds.asDataMatrix}
#' @author Paul Burton for DataSHIELD Development Team
#' @export
asDataMatrixDS <- function (x.name){

if(is.character(x.name)){
x<-eval(parse(text=x.name), envir = parent.frame())

}else{
studysideMessage<-"ERROR: x.name must be specified as a character string"
stop(studysideMessage, call. = FALSE)
}
asDataMatrixDS <- function(x.name) {
if (is.character(x.name)) {
x <- eval(parse(text = x.name), envir = parent.frame())
} else {
studysideMessage <- "ERROR: x.name must be specified as a character string"
stop(studysideMessage, call. = FALSE)
}

output <- data.matrix(x)

Expand Down
2 changes: 1 addition & 1 deletion R/asFactorDS2.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @param all.unique.levels.transmit the levels that the variable will be transmitted to.
#' @param fixed.dummy.vars a boolean that determines whether the new object will be represented as
#' a vector or as a matrix of dummy variables indicating the factor level of each data point.
#' If this argyment is set to FALSE (default) then the input variable is converted to a factor and
#' If this argument is set to FALSE (default) then the input variable is converted to a factor and
#' assigned as a vector. If is set to TRUE then the input variable is converted to a factor but
#' assigned as a matrix of dummy variables.
#' @param baseline.level a number indicating the baseline level to be used in the creation of the
Expand Down
9 changes: 6 additions & 3 deletions R/blackBoxDS.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ blackBoxDS <- function(input.var.name=NULL,
#nfilter.noise <- as.numeric(thr$nfilter.noise)
#nfilter.levels <- as.numeric(thr$nfilter.levels)
########################################################


# back-up current .Random.seed and revert on.exit
old_seed <- .Random.seed
on.exit(.Random.seed <- old_seed, add = TRUE)

input.var <- eval(parse(text=input.var.name), envir = parent.frame())

Expand Down Expand Up @@ -311,7 +314,7 @@ utils::head(rank.intermediate.value.matrix)
utils::tail(rank.intermediate.value.matrix)


cat("\nRANKS IN ALL COLUMNS ABOVE SHOULD BE THE SAME\n")
message("\nRANKS IN ALL COLUMNS ABOVE SHOULD BE THE SAME\n")

control.vector
control.value
Expand Down Expand Up @@ -365,7 +368,7 @@ if(sum(round(rank(blackbox.output.df[,3])-rank(blackbox.output.df[,4]),2)==0)!=n
of memory")
stop(error.message, call. = FALSE)
}else{
cat("\nPROCESSING SUCCESSFUL, ALL RANKS AGREE FOR ALL TRANSFORMATIONS\n\n")
message("\nPROCESSING SUCCESSFUL, ALL RANKS AGREE FOR ALL TRANSFORMATIONS\n\n")
}


Expand Down
7 changes: 5 additions & 2 deletions R/blackBoxRanksDS.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ blackBoxRanksDS <- function(input.var.name=NULL, shared.seedval){ #START FUNC
#nfilter.levels <- as.numeric(thr$nfilter.levels)
########################################################

# back-up current .Random.seed and revert on.exit
old_seed <- .Random.seed
on.exit(.Random.seed <- old_seed, add = TRUE)

input.var <- eval(parse(text=input.var.name), envir = parent.frame())
input.global.ranks<-input.var
Expand Down Expand Up @@ -189,7 +192,7 @@ colnames(rank.intermediate.value.matrix)<-c("input.global.ranks.orig","input.var
1:6,"ID.seq.real.orig")


cat("\nRANKS IN ALL COLUMNS ABOVE SHOULD BE THE SAME\n")
message("\nRANKS IN ALL COLUMNS ABOVE SHOULD BE THE SAME\n")

control.vector
control.value
Expand Down Expand Up @@ -255,7 +258,7 @@ if(sum(round(rank(blackbox.ranks.df[,5])-rank(blackbox.ranks.df[,8]),2)==0)!=num
of memory")
stop(error.message, call. = FALSE)
}else{
cat("\nPROCESSING SUCCESSFUL, ALL RANKS AGREE FOR ALL TRANSFORMATIONS\n\n")
message("\nPROCESSING SUCCESSFUL, ALL RANKS AGREE FOR ALL TRANSFORMATIONS\n\n")
}


Expand Down
Loading
Loading