Skip to content

Commit 89e1154

Browse files
Merge pull request #392 from villegar/v6.3.3-dev
V6.3.3 dev - CRAN submission
2 parents 411049b + 03d3310 commit 89e1154

64 files changed

Lines changed: 429 additions & 427 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

.github/workflows/R-CMD-check.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
8+
name: R-CMD-check.yaml
9+
10+
permissions: read-all
11+
12+
jobs:
13+
R-CMD-check:
14+
runs-on: ${{ matrix.config.os }}
15+
16+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
config:
22+
- {os: macos-latest, r: 'release'}
23+
- {os: windows-latest, r: 'release'}
24+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
25+
- {os: ubuntu-latest, r: 'release'}
26+
- {os: ubuntu-latest, r: 'oldrel-1'}
27+
28+
env:
29+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
30+
R_KEEP_PKG_SOURCE: yes
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- uses: r-lib/actions/setup-pandoc@v2
36+
37+
- uses: r-lib/actions/setup-r@v2
38+
with:
39+
r-version: ${{ matrix.config.r }}
40+
http-user-agent: ${{ matrix.config.http-user-agent }}
41+
use-public-rspm: true
42+
43+
- uses: r-lib/actions/setup-r-dependencies@v2
44+
with:
45+
extra-packages: any::rcmdcheck
46+
needs: check
47+
48+
- uses: r-lib/actions/check-r-package@v2
49+
with:
50+
upload-snapshots: true
51+
build_args: 'c("--no-manual", "--as-cran", "--compact-vignettes=gs+qpdf")'

DESCRIPTION

Lines changed: 3 additions & 178 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: dsBase
2-
Title: DataSHIELD Server Site Base Functions
3-
Description: Base DataSHIELD functions for the server side. DataSHIELD is a software package which allows
4-
you to do non-disclosive federated analysis on sensitive data. DataSHIELD analytic functions have
2+
Title: 'DataSHIELD' Server Site Base Functions
3+
Description: Base 'DataSHIELD' functions for the server side. 'DataSHIELD' is a software package which allows
4+
you to do non-disclosive federated analysis on sensitive data. 'DataSHIELD' analytic functions have
55
been designed to only share non disclosive summary statistics, with built in automated output
66
checking based on statistical disclosure control. With data sites setting the threshold values for
77
the automated output checks.
@@ -59,180 +59,5 @@ Imports:
5959
childsds
6060
Suggests:
6161
testthat
62-
AggregateMethods:
63-
asFactorDS1,
64-
asListDS,
65-
aucDS,
66-
boxPlotGGDS,
67-
checkNegValueDS,
68-
classDS,
69-
colnamesDS,
70-
corTestDS,
71-
corDS,
72-
covDS,
73-
dataFrameSubsetDS1,
74-
densityGridDS,
75-
extractQuantilesDS1,
76-
extractQuantilesDS2,
77-
dimDS,
78-
gamlssDS,
79-
glmDS1,
80-
glmDS2,
81-
glmerSLMADS2,
82-
glmPredictDS.ag,
83-
glmSLMADS1,
84-
glmSLMADS2,
85-
glmSummaryDS.ag,
86-
heatmapPlotDS,
87-
hetcorDS,
88-
histogramDS1,
89-
histogramDS2,
90-
isNaDS,
91-
isValidDS,
92-
kurtosisDS1,
93-
kurtosisDS2,
94-
lengthDS,
95-
levelsDS,
96-
lexisDS1,
97-
listDisclosureSettingsDS,
98-
lmerSLMADS2,
99-
lsDS,
100-
matrixDetDS1,
101-
meanDS,
102-
meanSdGpDS,
103-
messageDS,
104-
metadataDS,
105-
miceDS,
106-
minMaxRandDS,
107-
namesDS,
108-
numNaDS,
109-
quantileMeanDS,
110-
rangeDS,
111-
ranksSecureDS1,
112-
ranksSecureDS3,
113-
rmDS,
114-
scatterPlotDS,
115-
scoreVectDS,
116-
setSeedDS,
117-
skewnessDS1,
118-
skewnessDS2,
119-
table1DDS,
120-
table2DDS,
121-
tableDS,
122-
tableDS2,
123-
tapplyDS,
124-
testObjExistsDS,
125-
varDS,
126-
exists=base::exists,
127-
is.character=base::is.character,
128-
is.factor=base::is.factor,
129-
is.list=base::is.list,
130-
is.null=base::is.null,
131-
is.numeric=base::is.numeric,
132-
NROW=base::NROW,
133-
t.test=stats::t.test
134-
AssignMethods:
135-
absDS,
136-
asCharacterDS,
137-
asDataMatrixDS,
138-
asFactorDS2,
139-
asFactorSimpleDS,
140-
asIntegerDS,
141-
asListDS,
142-
asLogicalDS,
143-
asMatrixDS,
144-
asNumericDS,
145-
blackBoxDS,
146-
blackBoxRanksDS,
147-
BooleDS,
148-
boxPlotGG_data_TreatmentDS,
149-
boxPlotGG_data_Treatment_numericDS,
150-
bp_standardsDS,
151-
cbindDS,
152-
cDS,
153-
changeRefGroupDS,
154-
completeCasesDS,
155-
dataFrameDS,
156-
dataFrameFillDS,
157-
dataFrameSortDS,
158-
dataFrameSubsetDS2,
159-
dmtC2SDS,
160-
elsplineDS,
161-
glmerSLMADS.assign,
162-
glmPredictDS.as,
163-
glmSLMADS.assign,
164-
glmSummaryDS.as,
165-
getWGSRDS,
166-
igb_standardsDS,
167-
listDS,
168-
lexisDS2,
169-
lexisDS3,
170-
lmerSLMADS.assign,
171-
lsplineDS,
172-
matrixDetDS2,
173-
matrixDiagDS,
174-
matrixDimnamesDS,
175-
matrixDS,
176-
matrixInvertDS,
177-
matrixMultDS,
178-
matrixTransposeDS,
179-
mergeDS,
180-
nsDS,
181-
qlsplineDS,
182-
ranksSecureDS2,
183-
ranksSecureDS4,
184-
ranksSecureDS5,
185-
rbindDS,
186-
rBinomDS,
187-
recodeLevelsDS,
188-
recodeValuesDS,
189-
repDS,
190-
replaceNaDS,
191-
reShapeDS,
192-
rNormDS,
193-
rowColCalcDS,
194-
rPoisDS,
195-
rUnifDS,
196-
sampleDS,
197-
seqDS,
198-
sqrtDS,
199-
subsetByClassDS,
200-
subsetDS,
201-
tableDS.assign,
202-
tapplyDS.assign,
203-
uniqueDS,
204-
unListDS,
205-
vectorDS,
206-
as.character=base::as.character,
207-
as.null=base::as.null,
208-
as.numeric=base::as.numeric,
209-
attach=base::attach,
210-
c=dsBase::vectorDS,
211-
complete.cases=stats::complete.cases,
212-
list=base::list,
213-
exp=base::exp,
214-
log=base::log,
215-
sqrt=base::sqrt,
216-
abs=base::abs,
217-
sin=base::sin,
218-
cos=base::cos,
219-
tan=base::tan,
220-
asin=base::asin,
221-
acos=base::acos,
222-
atan=base::atan,
223-
sum=base::sum,
224-
unlist=base::unlist
225-
Options:
226-
datashield.privacyLevel=5,
227-
default.datashield.privacyControlLevel="banana",
228-
default.nfilter.glm=0.33,
229-
default.nfilter.kNN=3,
230-
default.nfilter.string=80,
231-
default.nfilter.subset=3,
232-
default.nfilter.stringShort=20,
233-
default.nfilter.tab=3,
234-
default.nfilter.noise=0.25,
235-
default.nfilter.levels.density=0.33,
236-
default.nfilter.levels.max=40
23762
RoxygenNote: 7.3.2
23863
Encoding: UTF-8

R/BooleDS.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
#' @param na.assign.text A character string taking values 'NA', '1' or '0'. If 'NA'
1919
#' then any NA values in the
2020
#' input vector remain as NAs in the output vector. If '1' or '0' NA values in the
21-
#' input vector are
22-
#' all converted to 1 or 0 respectively.#' @return the levels of the input variable.
21+
#' input vector are all converted to 1 or 0 respectively.
22+
#'
2323
#' @author DataSHIELD Development Team
24+
#'
25+
#' @return the levels of the input variable.
2426
#' @export
2527
#'
2628
BooleDS <- function(V1.name=NULL, V2.name=NULL, Boolean.operator.n=NULL, na.assign.text, numeric.output=TRUE){

R/absDS.R

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,19 @@
66
#' @param x a string character, the name of a numeric or integer vector
77
#' @return the object specified by the \code{newobj} argument
88
#' of \code{ds.abs} (or default name \code{abs.newobj})
9-
#' which is written to the serverside. The output object is of class numeric
9+
#' which is written to the serverside. The output object is of class numeric
1010
#' or integer.
1111
#' @author Demetris Avraam for DataSHIELD Development Team
1212
#' @export
1313
#'
14-
absDS <- function(x){
15-
16-
x.var <- eval(parse(text=x), envir = parent.frame())
14+
absDS <- function(x) {
15+
x.var <- eval(parse(text = x), envir = parent.frame())
1716

1817
# compute the absolute values of x
1918
out <- abs(x.var)
20-
19+
2120
# assign the outcome to the data servers
2221
return(out)
23-
2422
}
2523
# ASSIGN FUNCTION
2624
# absDS

R/asCharacterDS.R

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#'
1+
#'
22
#' @title Coerces an R object into class character
33
#' @description this function is based on the native R function \code{as.character}
44
#' @details See help for function \code{as.character} in native R
@@ -11,14 +11,12 @@
1111
#' details see help on the clientside function \code{ds.asCharacter}
1212
#' @author Amadou Gaye, Paul Burton, Demetris Avraam for DataSHIELD Development Team
1313
#' @export
14-
#'
15-
asCharacterDS <- function (x.name){
16-
17-
x<-eval(parse(text=x.name), envir = parent.frame())
14+
#'
15+
asCharacterDS <- function(x.name) {
16+
x <- eval(parse(text = x.name), envir = parent.frame())
1817

1918
output <- as.character(x)
2019
return(output)
21-
2220
}
2321
# ASSIGN FUNCTION
2422
# asCharacterDS

R/asDataMatrixDS.R

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@
1616
#' details see help on the clientside function \code{ds.asDataMatrix}
1717
#' @author Paul Burton for DataSHIELD Development Team
1818
#' @export
19-
asDataMatrixDS <- function (x.name){
20-
21-
if(is.character(x.name)){
22-
x<-eval(parse(text=x.name), envir = parent.frame())
23-
24-
}else{
25-
studysideMessage<-"ERROR: x.name must be specified as a character string"
26-
stop(studysideMessage, call. = FALSE)
27-
}
19+
asDataMatrixDS <- function(x.name) {
20+
if (is.character(x.name)) {
21+
x <- eval(parse(text = x.name), envir = parent.frame())
22+
} else {
23+
studysideMessage <- "ERROR: x.name must be specified as a character string"
24+
stop(studysideMessage, call. = FALSE)
25+
}
2826

2927
output <- data.matrix(x)
3028

R/asFactorDS2.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#' @param all.unique.levels.transmit the levels that the variable will be transmitted to.
1010
#' @param fixed.dummy.vars a boolean that determines whether the new object will be represented as
1111
#' a vector or as a matrix of dummy variables indicating the factor level of each data point.
12-
#' If this argyment is set to FALSE (default) then the input variable is converted to a factor and
12+
#' If this argument is set to FALSE (default) then the input variable is converted to a factor and
1313
#' assigned as a vector. If is set to TRUE then the input variable is converted to a factor but
1414
#' assigned as a matrix of dummy variables.
1515
#' @param baseline.level a number indicating the baseline level to be used in the creation of the

R/blackBoxDS.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ blackBoxDS <- function(input.var.name=NULL,
6565
#nfilter.noise <- as.numeric(thr$nfilter.noise)
6666
#nfilter.levels <- as.numeric(thr$nfilter.levels)
6767
########################################################
68-
68+
69+
# back-up current .Random.seed and revert on.exit
70+
old_seed <- .Random.seed
71+
on.exit(.Random.seed <- old_seed, add = TRUE)
6972

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

@@ -311,7 +314,7 @@ utils::head(rank.intermediate.value.matrix)
311314
utils::tail(rank.intermediate.value.matrix)
312315

313316

314-
cat("\nRANKS IN ALL COLUMNS ABOVE SHOULD BE THE SAME\n")
317+
message("\nRANKS IN ALL COLUMNS ABOVE SHOULD BE THE SAME\n")
315318

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

371374

R/blackBoxRanksDS.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ blackBoxRanksDS <- function(input.var.name=NULL, shared.seedval){ #START FUNC
6161
#nfilter.levels <- as.numeric(thr$nfilter.levels)
6262
########################################################
6363

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

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

191194

192-
cat("\nRANKS IN ALL COLUMNS ABOVE SHOULD BE THE SAME\n")
195+
message("\nRANKS IN ALL COLUMNS ABOVE SHOULD BE THE SAME\n")
193196

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

261264

0 commit comments

Comments
 (0)