Skip to content

Commit 93f52fe

Browse files
committed
Merge changes from v6.3.6-dev
2 parents 5c5b26a + d41f142 commit 93f52fe

50 files changed

Lines changed: 616 additions & 80 deletions

Some content is hidden

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

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Description: Base 'DataSHIELD' functions for the client side. 'DataSHIELD' is a
55
you to do non-disclosive federated analysis on sensitive data. 'DataSHIELD' analytic functions have
66
been designed to only share non disclosive summary statistics, with built in automated output
77
checking based on statistical disclosure control. With data sites setting the threshold values for
8-
the automated output checks. For more details, see citation("dsBaseClient").
8+
the automated output checks. For more details, see citation('dsBaseClient').
99
Authors@R: c(person(given = "Paul",
1010
family = "Burton",
1111
role = c("aut"),

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ export(ds.unList)
117117
export(ds.unique)
118118
export(ds.var)
119119
export(ds.vectorCalc)
120+
export(subsetHelper)
120121
import(DSI)
121122
import(data.table)
122123
importFrom(stats,as.formula)

R/ds.boxPlot.R

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#' ## Version 6, for version 5 see the Wiki
2222
#'
2323
#' ### Please ensure you have a training Virtual Machine running,
24-
#' or that you have a live connection to a server.
24+
#' # or that you have a live connection to a server.
2525
#'
2626
#' # Connecting to the Opal servers
2727
#'
@@ -48,37 +48,37 @@
4848
#' symbol = "D")
4949
#'
5050
#' ## Create a boxplot of one variable
51-
#' ds.boxPlot("D", "LAB_HDL", datasources = connections)
51+
#' ds.boxPlot("D", "LAB_HDL", datasources = connections)
5252
#'
5353
#' ## Create a boxplot that is split by study:
54-
#' ds.boxPlot("D", "LAB_HDL", type= "split", datasources = connections)
54+
#' ds.boxPlot("D", "LAB_HDL", type= "split", datasources = connections)
5555
#'
5656
#' ## Create a boxplot of two variables variable
57-
#' ds.boxPlot("D", c("LAB_HDL", "LAB_TRIG", type="pooled",
58-
#' datasources = connections)
57+
#' ds.boxPlot("D", c("LAB_HDL", "LAB_TRIG"), type="pooled",
58+
#' datasources = connections)
5959
#' # only one plot is created (of the aggregated results of all servers)
6060
#'
6161
#' ## Create a boxplot of two variables, which are split by a factor
62-
#' ds.boxPlot("D", c("LAB_HDL", "LAB_TRIG"), group = "GENDER",
62+
#' ds.boxPlot("D", c("LAB_HDL", "LAB_TRIG"), group = "GENDER",
6363
#' datasources = connections)
6464
#'
6565
#' ## Create a boxplot with x- and y-axis labels
66-
#' ds.boxPlot("D", c("LAB_HDL", "LAB_TRIG"), group = "GENDER",
66+
#' ds.boxPlot("D", c("LAB_HDL", "LAB_TRIG"), group = "GENDER",
6767
#' xlabel = "Variable", ylabel = "Measurement", datasources = connections)
6868
#'
6969
#' ## Improve the presentation of ds.boxplot output using ggplot:
7070
#' ### User must save the output, which is in a ggplot format already:
71-
#' a <- ds.boxPlot("D", c("LAB_HDL", "LAB_TRIG"), group = "GENDER",
71+
#' a <- ds.boxPlot("D", c("LAB_HDL", "LAB_TRIG"), group = "GENDER",
7272
#' xlabel = "Variable", ylabel = "Measurement", datasources = connections)
7373
#'
7474
#' ### Then customise output "a" using ggplot tools:
7575
#' a + ggplot2::scale_fill_discrete(name = "Gender", labels = c("Male", "Female"))
7676
#'
7777
#' ### Or use an alternative way, to maintain the aesthetics:
78-
#' a + ggplot2::scale_fill_brewer(name = "Gender", labels = c("Male", "Female"))
78+
#' a + ggplot2::scale_fill_brewer(name = "Gender", labels = c("Male", "Female"))
7979
#'
8080
#' # Clear the Datashield R sessions and logout
81-
#' datashield.logout(connections)
81+
#' datashield.logout(connections)
8282
#'
8383
#' }
8484
#'

R/ds.densityGrid.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@
6666
#' # Example2: generate a grid density object for each study separately
6767
#' ds.densityGrid(x="D$LAB_TSC",
6868
#' y="D$LAB_HDL",
69-
#' type="split"
69+
#' type="split",
7070
#' datasources = connections[1])#only the first Opal server is used ("study1")
7171
#'
7272
#' # Example3: generate a grid density object where the number of intervals is set to 15, for
73-
#' each study separately
73+
#' # each study separately
7474
#' ds.densityGrid(x="D$LAB_TSC",
7575
#' y="D$LAB_HDL",
7676
#' type="split",

R/ds.heatmapPlot.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
#' datasources = connections[1]) #only the first server is used (study1)
134134
#'
135135
#' # Example 3: Plot a combined heat map plot using the method 'deterministic' centroids of each
136-
#' k = 7 nearest neighbours for numints = 40
136+
#' # k = 7 nearest neighbours for numints = 40
137137
#' ds.heatmapPlot(x = 'D$LAB_TSC',
138138
#' y = 'D$LAB_HDL',
139139
#' numints = 40,

R/ds.histogram.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
#' datasources = connections) #all studies are used
121121
#'
122122
#' # Example 2: generate a combined histogram with the default small cells counts
123-
#' suppression rule
123+
#' # suppression rule
124124
#' ds.histogram(x = 'D$PM_BMI_CONTINUOUS',
125125
#' method = 'smallCellsRule',
126126
#' type = 'combine',

R/ds.matrixDiag.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
#' datasources = connections)
113113
#'
114114
#' #Example 2: Create a square matrix with the server-side scalar as all diagonal values
115-
#' and all the other values = 0
115+
#' #and all the other values = 0
116116
#'
117117
#' #Create a scalar in the server-side
118118
#'
@@ -152,7 +152,7 @@
152152
#' datasources = connections)
153153
#'
154154
#' #Example 4: Create a square matrix with the client-side vector as a diagonal
155-
#' and all the other values = 0
155+
#' #and all the other values = 0
156156
#'
157157
#' ds.matrixDiag(x1 = c(2,6,9,10),
158158
#' aim = "clientside.vector.2.matrix",
@@ -161,7 +161,7 @@
161161
#' datasources = connections)
162162
#'
163163
#' #Example 5: Create a square matrix with the client-side scalar as all diagonal values
164-
#' and all the other values = 0
164+
#' #and all the other values = 0
165165
#'
166166
#' ds.matrixDiag(x1 = 4,
167167
#' aim = "clientside.scalar.2.matrix",

R/ds.recodeValues.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
#' values2replace.vector = c(1,2),
7070
#' new.values.vector = c(1,2),
7171
#' missing = 99,
72-
#' newobj = 'bmi_recoded'
72+
#' newobj = 'bmi_recoded',
7373
#' datasources = connections)
7474
#'
7575
#' # Clear the Datashield R sessions and logout

R/ds.table.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,6 +1539,12 @@ if(num.table.dims==1)
15391539

15401540
}#END second dim=1 loop
15411541

1542+
#################################################
1543+
# Setup on.exit() to restore options 'warn' value
1544+
#################################################
1545+
1546+
old_warn_option <- base::getOption("warn")
1547+
on.exit(base::options(warn = old_warn_option), add = TRUE)
15421548

15431549
################################
15441550
#NOW UNDERTAKE CHISQUARED TESTS#

R/ds.table2D.R

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
#' # Example 2: generate a two dimensional table, outputting study specific contingency tables
5757
#' ds.table2D(x='D$DIS_DIAB', y='D$GENDER', type='split')
5858
#' # display the 5 results items, one at a time to avoid having too much information displayed
59-
#' at the same time
59+
#' # at the same time
6060
#' output$counts
6161
#' output$rowPercent
6262
#' output$colPercent
@@ -112,6 +112,13 @@ ds.table2D <- function(x=NULL, y=NULL, type='both', warningMessage=TRUE, datasou
112112
stop("Function argument 'type' has to be either 'combine', 'split' or 'both'")
113113
}
114114

115+
#################################################
116+
# Setup on.exit() to restore options 'warn' value
117+
#################################################
118+
119+
old_warn_option <- base::getOption("warn")
120+
on.exit(base::options(warn = old_warn_option), add = TRUE)
121+
115122
# the input variable might be given as column table (i.e. D$x)
116123
# or just as a vector not attached to a table (i.e. x)
117124
# we have to make sure the function deals with each case

0 commit comments

Comments
 (0)