Skip to content

Commit 6713e25

Browse files
committed
Package update plus document update
2 parents 59a8060 + 7ca1a97 commit 6713e25

410 files changed

Lines changed: 2418 additions & 1036 deletions

File tree

Some content is hidden

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

.Rbuildignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
^R/secure.global.ranking.md$
1818
^_pkgdown\.yml$
1919
^docs$
20-
^dsBase_6.3.1.tar.gz$
21-
^dsBase_6.3.1-permissive.tar.gz$
20+
^dsBase_6.3.2.tar.gz$
21+
^dsBase_6.3.2-permissive.tar.gz$
2222
^dsDanger_6.3.1.tar.gz$
2323
^\.circleci$
2424
^\.circleci/config\.yml$

.circleci/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ jobs:
4747
sudo Rscript -e "install.packages('ggplot2', dependencies=TRUE)"
4848
sudo Rscript -e "install.packages('gridExtra', dependencies=TRUE)"
4949
sudo Rscript -e "install.packages('data.table', dependencies=TRUE)"
50-
sudo Rscript -e "install.packages('panelaggregation', dependencies=TRUE)"
5150
sudo Rscript -e "install.packages('methods', dependencies=TRUE)"
5251
sudo Rscript -e "install.packages('dplyr', dependencies=TRUE)"
5352
sudo Rscript -e "install.packages('DSI', dependencies=TRUE)"

DESCRIPTION

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,47 @@
11
Package: dsBaseClient
22
Title: DataSHIELD Client Functions
33
Version: 6.4.0.9000
4-
Author: DataSHIELD Developers <datashield@liverpool.ac.uk>
5-
Maintainer: DataSHIELD Developers <datashield@liverpool.ac.uk>
6-
Description: DataSHIELD client functions for the client side.
4+
Description: Base DataSHIELD functions for the client side. DataSHIELD is a software package which allows
5+
you to do non-disclosive federated analysis on sensitive data. DataSHIELD analytic functions have
6+
been designed to only share non disclosive summary statistics, with built in automated output
7+
checking based on statistical disclosure control. With data sites setting the threshold values for
8+
the automated output checks.
9+
Authors@R: c(person(given = "Paul",
10+
family = "Burton",
11+
role = c("aut")),
12+
person(given = "Rebecca",
13+
family = "Wilson",
14+
role = c("aut")),
15+
person(given = "Olly",
16+
family = "Butters",
17+
role = c("aut")),
18+
person(given = "Patricia",
19+
family = "Ryser-Welch",
20+
role = c("aut")),
21+
person(given = "Alex",
22+
family = "Westerberg",
23+
role = c("aut")),
24+
person(given = "Leire",
25+
family = "Abarrategui",
26+
role = c("aut")),
27+
person(given = "Roberto",
28+
family = "Villegas-Diaz",
29+
role = c("aut"),
30+
comment = c(ORCID = "0000-0001-5036-8661")),
31+
person(given = "Demetris",
32+
family = "Avraam",
33+
role = c("aut"),
34+
comment = c(ORCID = "0000-0001-8908-2441")),
35+
person(given = "Yannick",
36+
family = "Marcon",
37+
role = c("aut"),
38+
email = "yannick.marcon@obiba.org",
39+
comment = c(ORCID = "0000-0003-0138-2023")),
40+
person(given = "Stuart",
41+
family = "Wheater",
42+
role = c("aut", "cre"),
43+
email = "stuart.wheater@arjuna.com",
44+
comment = c(ORCID = "0009-0003-2419-1964")))
745
License: GPL-3
846
Depends:
947
R (>= 4.0.0),
@@ -15,7 +53,6 @@ Imports:
1553
ggplot2,
1654
gridExtra,
1755
data.table,
18-
panelaggregation,
1956
methods,
2057
dplyr
2158
Suggests:

NAMESPACE

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Generated by roxygen2: do not edit by hand
22

3+
export(computeWeightedMeans)
34
export(ds.Boole)
45
export(ds.abs)
56
export(ds.asCharacter)
@@ -116,3 +117,7 @@ export(ds.var)
116117
export(ds.vectorCalc)
117118
import(DSI)
118119
import(data.table)
120+
importFrom(stats,as.formula)
121+
importFrom(stats,na.omit)
122+
importFrom(stats,ts)
123+
importFrom(stats,weighted.mean)

R/checkClass.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#' @description This is an internal function.
44
#' @details In DataSHIELD an object included in analysis must be of the same type in all
55
#' the collaborating studies. If that is not the case the process is stopped
6-
#' @param datasources a list of \code{\link{DSConnection-class}} objects obtained after login. If the <datasources>
7-
#' the default set of connections will be used: see \link{datashield.connections_default}.
6+
#' @param datasources a list of \code{\link[DSI]{DSConnection-class}} objects obtained after login. If the <datasources>
7+
#' the default set of connections will be used: see \link[DSI]{datashield.connections_default}.
88
#' @param obj a string character, the name of the object to check for.
99
#' @keywords internal
1010
#' @return a message or the class of the object if the object has the same class in all studies.

R/computeWeightedMeans.R

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#' Compute Weighted Mean by Group
2+
#'
3+
#' This function is originally from the panelaggregation package.
4+
#' It has been ported here in order to bypass the package being
5+
#' kicked off CRAN.
6+
#'
7+
#' @author Matthias Bannert, Gabriel Bucur
8+
#' @param data_table a data.table
9+
#' @param variables character name of the variable(s) to focus on. The variables must be in the data.table
10+
#' @param weight character name of the data.table column that contains a weight.
11+
#' @param by character vector of the columns to group by
12+
#' @import data.table
13+
#' @importFrom stats as.formula na.omit ts weighted.mean
14+
#' @export
15+
computeWeightedMeans <- function(data_table, variables, weight, by) {
16+
17+
if (is.null(weight)) {
18+
res_dt <- data_table[, lapply(.SD, mean, na.rm = TRUE), .SDcols = variables, by = by]
19+
} else {
20+
res_dt <- data_table[, lapply(.SD, weighted.mean, weight = eval(as.name(weight)), na.rm = TRUE),
21+
.SDcols = variables, by = by]
22+
}
23+
24+
res_dt
25+
}

R/ds.Boole.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
#' Default \code{'NA'}. For more information see details.
3535
#' @param newobj a character string that provides the name for the output
3636
#' object that is stored on the data servers. Default \code{boole.newobj}.
37-
#' @param datasources a list of \code{\link{DSConnection-class}}
37+
#' @param datasources a list of \code{\link[DSI]{DSConnection-class}}
3838
#' objects obtained after login. If the \code{datasources} argument is not specified
39-
#' the default set of connections will be used: see \code{\link{datashield.connections_default}}.
39+
#' the default set of connections will be used: see \code{\link[DSI]{datashield.connections_default}}.
4040
#' @return \code{ds.Boole} returns the object specified by the \code{newobj} argument
4141
#' which is written to the server-side. Also, two validity messages are returned
4242
#' to the client-side indicating the name of the \code{newobj} which

R/ds.abs.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
#' @param x a character string providing the name of a numeric or an integer vector.
1111
#' @param newobj a character string that provides the name for the output variable
1212
#' that is stored on the data servers. Default name is set to \code{abs.newobj}.
13-
#' @param datasources a list of \code{\link{DSConnection-class}} objects obtained after login.
13+
#' @param datasources a list of \code{\link[DSI]{DSConnection-class}} objects obtained after login.
1414
#' If the \code{datasources} argument is not specified the default set of connections will be
15-
#' used: see \code{\link{datashield.connections_default}}.
15+
#' used: see \code{\link[DSI]{datashield.connections_default}}.
1616
#' @return \code{ds.abs} assigns a vector for each study that includes the absolute values of
1717
#' the input numeric or integer vector specified in the argument \code{x}. The created vectors
1818
#' are stored in the servers.

R/ds.asCharacter.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
#' character.
1010
#' @param newobj a character string that provides the name for the output object
1111
#' that is stored on the data servers. Default \code{ascharacter.newobj}.
12-
#' @param datasources a list of \code{\link{DSConnection-class}}
12+
#' @param datasources a list of \code{\link[DSI]{DSConnection-class}}
1313
#' objects obtained after login. If the \code{datasources} argument is not specified
14-
#' the default set of connections will be used: see \code{\link{datashield.connections_default}}.
14+
#' the default set of connections will be used: see \code{\link[DSI]{datashield.connections_default}}.
1515
#' @return \code{ds.asCharacter} returns the object converted into a class character
1616
#' that is written to the server-side. Also, two validity messages are returned to the client-side
1717
#' indicating the name of the \code{newobj} which has been created in each data source and if

R/ds.asDataMatrix.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#' a matrix.
99
#' @param newobj a character string that provides the name for the output object
1010
#' that is stored on the data servers. Default \code{asdatamatrix.newobj}.
11-
#' @param datasources a list of \code{\link{DSConnection-class}}
11+
#' @param datasources a list of \code{\link[DSI]{DSConnection-class}}
1212
#' objects obtained after login. If the \code{datasources} argument is not specified
13-
#' the default set of connections will be used: see \code{\link{datashield.connections_default}}.
13+
#' the default set of connections will be used: see \code{\link[DSI]{datashield.connections_default}}.
1414
#' @return \code{ds.asDataMatrix} returns the object converted into a matrix
1515
#' that is written to the server-side. Also, two validity messages are returned
1616
#' to the client-side

0 commit comments

Comments
 (0)