Skip to content

Commit b0cf1b3

Browse files
Merge pull request #61 from StuartWheater/temp_cran-version-fix
Updates for CRAN
2 parents 08b7b8c + 204b7f1 commit b0cf1b3

34 files changed

+151
-270
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Package: dsBaseClient
22
Title: 'DataSHIELD' Client Side Base Functions
3-
Version: 7.0.0-9000
3+
Version: 7.0.0.9000
44
Description: Base 'DataSHIELD' functions for the client side. 'DataSHIELD' is a software package which allows
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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Generated by roxygen2: do not edit by hand
22

3-
export(computeWeightedMeans)
43
export(ds.Boole)
54
export(ds.abs)
65
export(ds.asCharacter)

R/computeWeightedMeans.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
#' @param variables character name of the variable(s) to focus on. The variables must be in the data.table
1010
#' @param weight character name of the data.table column that contains a weight.
1111
#' @param by character vector of the columns to group by
12+
#' @return Returns a data table object with computed weighted means.
13+
#'
1214
#' @import data.table
1315
#' @importFrom stats as.formula na.omit ts weighted.mean
14-
#' @export
16+
#' @keywords internal
1517
computeWeightedMeans <- function(data_table, variables, weight, by) {
1618

1719
if (is.null(weight)) {

R/ds.cbind.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ ds.cbind <- function(x=NULL, DataSHIELD.checks=FALSE, force.colnames=NULL, newob
157157
}
158158
colNames <- unlist(colNames)
159159
if(anyDuplicated(colNames) != 0){
160-
cat("\n Warning: Some column names in study", j, "are duplicated and a suffix '.k' will be added to the kth replicate \n")
160+
message("\n Warning: Some column names in study", j, "are duplicated and a suffix '.k' will be added to the kth replicate \n")
161161
}
162162
}
163163
}
@@ -198,30 +198,30 @@ ds.cbind <- function(x=NULL, DataSHIELD.checks=FALSE, force.colnames=NULL, newob
198198
next.class <- DSI::datashield.aggregate(datasources[std], calltext1)
199199
class.vector <- c(class.vector, next.class[[1]])
200200
if (notify.of.progress){
201-
cat("\n",j," of ", length(x), " elements to combine in step 1 of 2 in study ", std, "\n")
201+
message("\n",j," of ", length(x), " elements to combine in step 1 of 2 in study ", std, "\n")
202202
}
203203
}
204204
for(j in 1:length(x)){
205205
test.df <- x[j]
206206
if(class.vector[j]!="data.frame" && class.vector[j]!="matrix"){
207207
colname.vector <- c(colname.vector, test.df)
208208
if (notify.of.progress){
209-
cat("\n",j," of ", length(x), " elements to combine in step 2 of 2 in study ", std, "\n")
209+
message("\n",j," of ", length(x), " elements to combine in step 2 of 2 in study ", std, "\n")
210210
}
211211
}else{
212212
calltext2 <- call('colnamesDS', test.df)
213213
df.names <- DSI::datashield.aggregate(datasources[std], calltext2)
214214
colname.vector <- c(colname.vector, df.names[[1]])
215215
if (notify.of.progress){
216-
cat("\n", j," of ", length(x), " elements to combine in step 2 of 2 in study ", std, "\n")
216+
message("\n", j," of ", length(x), " elements to combine in step 2 of 2 in study ", std, "\n")
217217
}
218218
}
219219
}
220220
colname.list[[std]] <- colname.vector
221221
}
222222

223223
if (notify.of.progress){
224-
cat("\nBoth steps in all studies completed\n")
224+
message("\nBoth steps in all studies completed\n")
225225
}
226226

227227
# prepare name vectors for transmission

R/ds.contourPlot.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ ds.contourPlot <- function(x=NULL, y=NULL, type='combine', show='all', numints=2
120120
stop("y=NULL. Please provide the names of two numeric vectors!", call.=FALSE)
121121
}
122122

123+
# Save par and setup reseting of par values
124+
old_par <- graphics::par(no.readonly = TRUE)
125+
on.exit(graphics::par(old_par), add = TRUE)
126+
123127
# check if the input objects are defined in all the studies
124128
isDefined(datasources, x)
125129
isDefined(datasources, y)

R/ds.dataFrame.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ ds.dataFrame <- function(x=NULL, row.names=NULL, check.rows=FALSE, check.names=T
137137
}
138138
colNames <- unlist(colNames)
139139
if(anyDuplicated(colNames) != 0){
140-
cat("\n Warning: Some column names in study", j, "are duplicated and a suffix '.k' will be added to the kth replicate \n")
140+
message("\n Warning: Some column names in study", j, "are duplicated and a suffix '.k' will be added to the kth replicate \n")
141141
}
142142
}
143143
}
@@ -178,30 +178,30 @@ ds.dataFrame <- function(x=NULL, row.names=NULL, check.rows=FALSE, check.names=T
178178
next.class <- DSI::datashield.aggregate(datasources[std], calltext1)
179179
class.vector <- c(class.vector, next.class[[1]])
180180
if (notify.of.progress){
181-
cat("\n",j," of ", length(x), " elements to combine in step 1 of 2 in study ", std, "\n")
181+
message("\n",j," of ", length(x), " elements to combine in step 1 of 2 in study ", std, "\n")
182182
}
183183
}
184184
for(j in 1:length(x)){
185185
test.df <- x[j]
186186
if(class.vector[j]!="data.frame" && class.vector[j]!="matrix"){
187187
colname.vector <- c(colname.vector, test.df)
188188
if (notify.of.progress){
189-
cat("\n",j," of ", length(x), " elements to combine in step 2 of 2 in study ", std, "\n")
189+
message("\n",j," of ", length(x), " elements to combine in step 2 of 2 in study ", std, "\n")
190190
}
191191
}else{
192192
calltext2 <- call('colnamesDS', test.df)
193193
df.names <- DSI::datashield.aggregate(datasources[std], calltext2)
194194
colname.vector <- c(colname.vector, df.names[[1]])
195195
if (notify.of.progress){
196-
cat("\n", j," of ", length(x), " elements to combine in step 2 of 2 in study ", std, "\n")
196+
message("\n", j," of ", length(x), " elements to combine in step 2 of 2 in study ", std, "\n")
197197
}
198198
}
199199
}
200200
colname.list[[std]] <- colname.vector
201201
}
202202

203203
if (notify.of.progress){
204-
cat("\nBoth steps in all studies completed\n")
204+
message("\nBoth steps in all studies completed\n")
205205
}
206206

207207
# prepare vectors for transmission

R/ds.dataFrameSubset.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,13 @@ if(!is.null(rm.cols)){
231231
if (notify.of.progress)
232232
{
233233
if(num.messages==1){
234-
cat("\nSource",s,"\n",return.warning.message[[s]][[1]],"\n")
234+
message("\nSource",s,"\n",return.warning.message[[s]][[1]],"\n")
235235
}else{
236-
cat("\nSource",s,"\n")
236+
message("\nSource",s,"\n")
237237
for(m in 1:(num.messages-1)){
238-
cat(return.warning.message[[s]][[m]],"\n")
238+
message(return.warning.message[[s]][[m]],"\n")
239239
}
240-
cat(return.warning.message[[s]][[num.messages]],"\n")
240+
message(return.warning.message[[s]][[num.messages]],"\n")
241241
}
242242
}
243243
}

R/ds.dmtC2S.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ if(dplyr::is.tbl(dfdata))
9393

9494
if(!is.matrix(dfdata) && !is.data.frame(dfdata) && !dplyr::is.tbl(dfdata))
9595
{
96-
cat("\n FAILED: <dfdata> must either be a data.frame, matrix or tibble")
96+
message("\n FAILED: <dfdata> must either be a data.frame, matrix or tibble")
9797
return('Please respecify')
9898
}
9999

R/ds.extractQuantiles.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ datasources.in.current.function<-datasources
224224
#CALL CLIENTSIDE FUNCTION ds.dmtC2S TO RETURN final.quantile.df TO SERVERSIDE
225225
dsBaseClient::ds.dmtC2S(dfdata=final.quantile.df,newobj="final.quantile.df",datasources = datasources.in.current.function)
226226

227-
cat("\n\n\n"," FINAL RANKING PROCEDURES COMPLETE:
227+
message("\n\n\n"," FINAL RANKING PROCEDURES COMPLETE:
228228
PRIMARY RANKING OUTPUT IS IN DATA FRAME",extract.summary.output.ranks.df,
229229
"
230230
WHICH IS SORTED BY",extract.ranks.sort.by," AND HAS BEEN

R/ds.forestplot.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#' See details from \code{?meta::metagen} for the different options.
1111
#' @param layout \code{character} (default \code{"JAMA"}) Layout of the plot.
1212
#' See details from \code{?meta::metagen} for the different options.
13+
#' @return Results a foresplot object created with `meta::forest`.
1314
#'
1415
#' @export
1516
#'

0 commit comments

Comments
 (0)