Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
43398e8
featÑ mdPatterns fct
ESCRI11 Oct 27, 2025
987fbcc
add mdPatterns to DATASHIELD
ESCRI11 Oct 27, 2025
16e22aa
Merge pull request #438 from ESCRI11/dev-task-14
StuartWheater Nov 2, 2025
eda4bdc
Initial 'mdPatternDS' tests
StuartWheater Nov 3, 2025
2e87305
Merge pull request #439 from StuartWheater/v6.3.5-dev
StuartWheater Nov 3, 2025
e499d8d
Additional mdPattern tests
StuartWheater Nov 3, 2025
3ba7b4c
Merge pull request #440 from StuartWheater/v6.3.5-dev
StuartWheater Nov 3, 2025
2485816
Increased data 'mdPatternDS' tests
StuartWheater Nov 3, 2025
cf61c2b
Added 'set.standard.disclosure.settings()'
StuartWheater Nov 4, 2025
e80c23f
Merge branch 'v6.3.5-dev' of github.com:StuartWheater/dsBase into v6.…
StuartWheater Nov 4, 2025
da36ab8
Updated 'mdPatternDS' tests
StuartWheater Nov 4, 2025
40e6425
Merge pull request #441 from StuartWheater/v6.3.5-dev
StuartWheater Nov 4, 2025
9b0fec1
Fix version
StuartWheater Nov 21, 2025
2a3b3fe
Update to docs
StuartWheater Nov 21, 2025
81f5f64
Remove nightly scheduled run and update call to parse_test_report.R
villegar Nov 26, 2025
e0d234f
Add session_info_*.txt as one of the log outputs and avoid storing du…
villegar Nov 26, 2025
42efdb6
Update 'perf' support
StuartWheater Nov 30, 2025
7c138f8
Merge branch 'v6.3.5-dev' of github.com:StuartWheater/dsBase into v6.…
StuartWheater Nov 30, 2025
27e5a1f
Merge pull request #446 from StuartWheater/v6.3.5-dev
StuartWheater Nov 30, 2025
998482c
Minor docs update
StuartWheater Nov 30, 2025
b335757
Merge branch 'v6.3.5-dev' of github.com:StuartWheater/dsBase into v6.…
StuartWheater Nov 30, 2025
5ae71ec
Merge pull request #447 from StuartWheater/v6.3.5-dev
StuartWheater Dec 1, 2025
bcfb6ae
Reworking of performance profiles
StuartWheater Jan 6, 2026
5af03c3
Merge branch 'v6.3.5-dev' of github.com:StuartWheater/dsBase into v6.…
StuartWheater Jan 6, 2026
2b201d6
Rework setting of variable
StuartWheater Jan 6, 2026
079a067
Merge pull request #449 from StuartWheater/v6.3.5-dev
StuartWheater Jan 6, 2026
9e3892d
Fixed Type
StuartWheater Jan 7, 2026
ee8d845
Merge branch 'datashield:v6.3.5-dev' into v6.3.5-dev
StuartWheater Jan 7, 2026
e21530a
Merge pull request #450 from StuartWheater/v6.3.5-dev
StuartWheater Jan 7, 2026
56ee2f1
Update test schedual
StuartWheater Feb 5, 2026
8665845
Merge branch 'v6.3.5-dev' of github.com:StuartWheater/dsBase into v6.…
StuartWheater Feb 5, 2026
05c8de2
Update test schedual
StuartWheater Feb 10, 2026
8c83782
Update version
StuartWheater Feb 20, 2026
69d4bb4
Update to glmSLMADS.assign
StuartWheater Feb 20, 2026
2a4a349
Update to documents
StuartWheater Feb 20, 2026
d79c7d2
Removed checking of 'opal'
StuartWheater Feb 20, 2026
1aa5c13
Merge pull request #458 from StuartWheater/v6.3.5-dev
StuartWheater Feb 22, 2026
2f6184e
Merge pull request #459 from datashield/v6.3.5-dev
StuartWheater Feb 23, 2026
fbdfa42
Permit perf test duration to be set, seconds, by environment variable…
StuartWheater Apr 10, 2026
1f12d53
Permit perf test duration to be set, seconds, by environment variable…
StuartWheater Apr 10, 2026
e75797b
Refactor perf test duration obtaining
StuartWheater Apr 13, 2026
b24d923
refactor: unListDS and replaceNaDS use .loadServersideObject
timcadman Apr 13, 2026
9a84af1
refactor: dataFrameFillDS, mergeDS, recodeValuesDS use .loadServersid…
timcadman Apr 13, 2026
7225324
refactor: cbindDS, dataFrameDS, rbindDS use .loadServersideObject
timcadman Apr 13, 2026
2554c55
refactor: complex functions use .loadServersideObject
timcadman Apr 13, 2026
6a1b21f
Merge pull request #468 from StuartWheater/v6.3.6-dev_feat-perf-support
StuartWheater Apr 14, 2026
65d5904
refactor: move checks to serverside
timcadman Apr 11, 2026
073bedc
test: update unit tests
timcadman Apr 11, 2026
7870e5b
fixed unit tests
timcadman Apr 11, 2026
3c9432e
updated authorship
timcadman Apr 11, 2026
8c44d30
refactor: return class for consistency checking, remove ValidityMessage
timcadman Apr 13, 2026
cabc097
chore: set privacy level to permissive, fix expDS authorship
timcadman Apr 13, 2026
f8fffa2
refactor: return class for consistency checking, remove ValidityMessage
timcadman Apr 13, 2026
e81a81b
fix: return class from corDS and covDS for consistency checking
timcadman Apr 13, 2026
05f68e6
test: fixed test expectations
timcadman Apr 14, 2026
b8ba480
docs: updated docs with authorship and parameters
timcadman Apr 14, 2026
1ff323f
revert: remove batch-4 cDS/listDS work leaked onto batch-3
timcadman Apr 14, 2026
0b6ab1a
fix: restore numeric-vector-requires-y guard in cor/covDS
timcadman Apr 14, 2026
1030579
refactor: cDS and listDS use .loadServersideObject
timcadman Apr 14, 2026
ab54ce0
fix: BooleDS accepts literal scalar V2
timcadman Apr 14, 2026
e5b300c
docs: redocument batch-4
timcadman Apr 14, 2026
713983f
docs: updated authorship
timcadman Apr 16, 2026
c4ff561
feat: add server-side functions for ds.standardiseDf
timcadman Apr 21, 2026
dd6133f
Added libuv1-dev to deployment
StuartWheater Apr 21, 2026
3b7b9d4
export functions
timcadman Apr 22, 2026
9f94f63
Merge branch 'datashield:v6.3.6-dev' into v6.3.6-dev
StuartWheater Apr 22, 2026
90b6f86
Update to perf test suppoer and 'libuv1'
StuartWheater Apr 22, 2026
d40d899
Add 'libuv1'
StuartWheater Apr 22, 2026
b01c923
Updated version to 'v6.3.6-dev'
StuartWheater Apr 22, 2026
baab62b
Merge pull request #476 from StuartWheater/v6.3.6-dev
StuartWheater Apr 23, 2026
1ce10e8
Merge branch 'v6.3.6-dev' into v6.3.6-dev-feat/standardise-df
StuartWheater Apr 23, 2026
3c64965
Switched to 'RoxygenNote: 8.0.0'
StuartWheater May 13, 2026
a71a4c0
feat: standardise-df
timcadman May 14, 2026
15dd8c4
Merge branch 'datashield:v6.3.6-dev' into v6.3.6-dev
StuartWheater May 14, 2026
69a7c12
Merge pull request #481 from StuartWheater/v6.3.6-dev
StuartWheater May 14, 2026
0c84090
revert: datashield privacy level to banana
timcadman Jun 9, 2026
38fdb08
Merge branch 'v7.0-dev' of github.com:datashield/dsBase into refactor…
timcadman Jun 12, 2026
c7825e1
chore: added files to ignore files
timcadman Jun 12, 2026
fde45bd
docs: removed old message about validity check
timcadman Jun 22, 2026
6d14225
revert whitespace changes
timcadman Jun 22, 2026
b16e729
added class as additional returns
timcadman Jun 22, 2026
9692ef8
Update to documentation
StuartWheater Jul 6, 2026
b288a3a
Updates due to testthats removal of context(...)
StuartWheater Jul 6, 2026
d6c761e
Merge pull request #491 from StuartWheater/v6.3.6-dev
StuartWheater Jul 6, 2026
4a8f612
chore: fix merge conflicts and redocument
timcadman Jul 7, 2026
db4b492
Merge pull request #492 from datashield/chore/merge-6.3.6
timcadman Jul 7, 2026
9efa319
Merge branch 'v7.0-dev' of https://github.com/datashield/dsBase into …
timcadman Jul 7, 2026
34ff567
Merge pull request #43 from datashield/v7.0-dev
StuartWheater Jul 7, 2026
42113c4
Merge pull request #471 from datashield/refactor/perf-batch-3
timcadman Jul 14, 2026
2853147
Merge branch 'datashield:v7.0-dev' into v7.0-dev
StuartWheater Jul 16, 2026
0b9f7f1
Merge pull request #473 from datashield/refactor/perf-batch-4
timcadman Jul 16, 2026
f6d844f
Merge branch 'datashield:v7.0-dev' into v7.0-dev
StuartWheater Jul 17, 2026
fbff8ac
Extended author list
StuartWheater Jul 22, 2026
e8b842d
Merge branch 'v7.0-dev' of github.com:StuartWheater/dsBase into v7.0-dev
StuartWheater Jul 22, 2026
4074c12
Merge pull request #499 from StuartWheater/v7.0-dev
StuartWheater Jul 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@
^cran-comments\.md$
^pull_request_template$
PULL_REQUEST_TEMPLATE.md
.claude
.idea
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
sudo apt-get install -y r-base-core cmake
- run:
command: |
sudo apt-get install -y libxml2-dev
sudo apt-get install -y libxml2-dev libuv1-dev
- run:
command: |
echo "options(Ncpus=4)" >> ~/.Rprofile
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/dsBase_test_suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ on:
push:
schedule:
- cron: '0 0 * * 0' # Weekly
- cron: '0 1 * * *' # Nightly

jobs:
dsBase_test_suite:
Expand Down Expand Up @@ -153,28 +152,30 @@ jobs:
echo "branch:${{ env.BRANCH_NAME }}" > ${{ env.WORKFLOW_ID }}.txt
echo "os:$(lsb_release -ds)" >> ${{ env.WORKFLOW_ID }}.txt
echo "R:$(R --version | head -n1)" >> ${{ env.WORKFLOW_ID }}.txt
Rscript --vanilla -e 'sessionInfo()' >> session_info_${{ env.WORKFLOW_ID }}.txt
working-directory: dsBase/logs

- name: Parse results from testthat and covr
run: |
Rscript --verbose --vanilla ../testStatus/source/parse_test_report.R logs/
Rscript --verbose --vanilla ../testStatus/source/parse_test_report.R logs/ logs/ https://github.com/datashield/${{ env.PROJECT_NAME }}/blob/${{ env.BRANCH_NAME }} '[^-:.]+' '(?<=::)[^:]+(?=::)'
working-directory: dsBase
env:
PROJECT_NAME: ${{ env.PROJECT_NAME }}
BRANCH_NAME: ${{ env.BRANCH_NAME }}

- name: Render report
run: |
cd testStatus

mkdir -p new/logs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/
mkdir -p new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/
mkdir -p new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/latest/

# Copy logs to new logs directory location
cp -rv ../${{ env.PROJECT_NAME }}/logs/* new/logs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/
cp -rv ../${{ env.PROJECT_NAME }}/logs/${{ env.WORKFLOW_ID }}.txt new/logs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/

R -e 'input_dir <- file.path("../new/logs", Sys.getenv("PROJECT_NAME"), Sys.getenv("BRANCH_NAME"), Sys.getenv("WORKFLOW_ID")); quarto::quarto_render("source/test_report.qmd", execute_params = list(input_dir = input_dir))'
mv source/test_report.html new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/index.html
cp -r new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/* new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/latest
mv source/test_report.html new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/latest/index.html

env:
PROJECT_NAME: ${{ env.PROJECT_NAME }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
.Rproj.user
.DS_Store
.Rapp.history
.claude
.idea
5 changes: 4 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,15 @@ Authors@R: c(person(given = "Paul",
comment = c(ORCID = "0009-0003-2419-1964")))
License: GPL-3
Depends:
R (>= 4.0.0)
R (>= 4.1.0)
Imports:
RANN,
stringr,
lme4,
dplyr,
tibble,
purrr,
tidyselect,
reshape2,
polycor (>= 0.8),
splines,
Expand Down
16 changes: 16 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ export(elsplineDS)
export(expDS)
export(extractQuantilesDS1)
export(extractQuantilesDS2)
export(fixClassDS)
export(fixColsDS)
export(fixLevelsDS)
export(gamlssDS)
export(getAllLevelsDS)
export(getClassAllColsDS)
export(getWGSRDS)
export(glmDS1)
export(glmDS2)
Expand Down Expand Up @@ -84,6 +89,7 @@ export(matrixDimnamesDS)
export(matrixInvertDS)
export(matrixMultDS)
export(matrixTransposeDS)
export(mdPatternDS)
export(meanDS)
export(meanSdGpDS)
export(mergeDS)
Expand Down Expand Up @@ -140,7 +146,17 @@ import(dplyr)
import(gamlss)
import(gamlss.dist)
import(mice)
importFrom(dplyr,"%>%")
importFrom(dplyr,across)
importFrom(dplyr,mutate)
importFrom(dplyr,select)
importFrom(gamlss.dist,pST3)
importFrom(gamlss.dist,qST3)
importFrom(glue,glue)
importFrom(glue,glue_collapse)
importFrom(purrr,imap)
importFrom(purrr,map)
importFrom(purrr,set_names)
importFrom(tibble,as_tibble)
importFrom(tidyselect,all_of)
importFrom(tidyselect,peek_vars)
12 changes: 10 additions & 2 deletions R/BooleDS.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#' input vector are all converted to 1 or 0 respectively.
#'
#' @author DataSHIELD Development Team
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#'
#' @return the levels of the input variable.
#' @export
Expand Down Expand Up @@ -50,8 +51,15 @@ thr <- dsBase::listDisclosureSettingsDS() #

##########CHECK NOT LONG SPECIFIED VECTOR##############

V1<-eval(parse(text=V1.name), envir = parent.frame())
V2<-eval(parse(text=V2.name), envir = parent.frame())
V1<-.loadServersideObject(V1.name)

# V2 may be either a server-side object name or a literal scalar (e.g. "3", "-1")
V2.numeric <- suppressWarnings(as.numeric(V2.name))
if(!is.na(V2.numeric)){
V2 <- V2.numeric
}else{
V2 <- .loadServersideObject(V2.name)
}


if(is.character(V1)){
Expand Down
24 changes: 13 additions & 11 deletions R/cDS.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,30 @@
#' @description This function is similar to the R base function 'c'.
#' @details Unlike the R base function 'c' on vector or list of certain
#' length are allowed as output
#' @param objs a list which contains the the objects to concatenate.
#' @param x.names a character vector of object names to concatenate.
#' @return a vector or list
#' @author Gaye, A.
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' @export
#'
cDS <- function (objs) {
#'
cDS <- function (x.names) {

# Check Permissive Privacy Control Level.
dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'avocado'))
# this filter sets the minimum number of observations that are allowed

# this filter sets the minimum number of observations that are allowed

#############################################################
# MODULE 1: CAPTURE THE nfilter SETTINGS
thr <- dsBase::listDisclosureSettingsDS()
nfilter.tab <- as.numeric(thr$nfilter.tab)
#nfilter.glm <- as.numeric(thr$nfilter.glm)
#nfilter.subset <- as.numeric(thr$nfilter.subset)
#nfilter.string <- as.numeric(thr$nfilter.string)
#############################################################

x <- unlist(objs)

objs <- list()
for (i in seq_along(x.names)) {
objs[[i]] <- .loadServersideObject(x.names[i])
}
x <- unlist(objs)

# check if the output is valid and output accordingly
if(length(x) < nfilter.tab){
Expand Down
13 changes: 8 additions & 5 deletions R/cbindDS.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#' of \code{ds.cbind} (or default name \code{cbind.newobj})
#' which is written to the serverside. The output object is of class data.frame.
#' @author Paul Burton and Demetris Avraam for DataSHIELD Development Team
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' @export
#'
cbindDS <- function(x.names.transmit=NULL, colnames.transmit=NULL){
Expand All @@ -28,11 +29,13 @@ cbindDS <- function(x.names.transmit=NULL, colnames.transmit=NULL){

x.names.input <- x.names.transmit
x.names.act1 <- unlist(strsplit(x.names.input, split=","))
x.names.act2 <- paste(x.names.act1, collapse=",")

eval.code.x.names <- paste0("data.frame(", x.names.act2, ")")

output.cbind <- eval(parse(text=eval.code.x.names), envir = parent.frame())

loaded.objects <- vector("list", length(x.names.act1))
for(i in seq_along(x.names.act1)) {
loaded.objects[[i]] <- .loadServersideObject(x.names.act1[i])
}

output.cbind <- do.call(data.frame, loaded.objects)

colnames.input <- colnames.transmit
colnames.act1 <- unlist(strsplit(colnames.input, split=","))
Expand Down
19 changes: 14 additions & 5 deletions R/corDS.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
#' sum of squares of each variable. The first disclosure control checks that the number of variables is
#' not bigger than a percentage of the individual-level records (the allowed percentage is pre-specified
#' by the 'nfilter.glm'). The second disclosure control checks that none of them is dichotomous with a
#' level having fewer counts than the pre-specified 'nfilter.tab' threshold.
#' level having fewer counts than the pre-specified 'nfilter.tab' threshold. The list also includes
#' \code{class}, the class of the input object for client-side consistency checking.
#' @author Paul Burton, and Demetris Avraam for DataSHIELD Development Team
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' @export
#'
corDS <- function(x=NULL, y=NULL){
Expand All @@ -27,14 +29,21 @@ corDS <- function(x=NULL, y=NULL){
nfilter.glm <- as.numeric(thr$nfilter.glm)
#############################################################

x.val <- eval(parse(text=x), envir = parent.frame())
x.val <- .loadServersideObject(x)
.checkClass(obj = x.val, obj_name = x, permitted_classes = c("numeric", "integer", "matrix", "data.frame"))

if (!is.null(y)){
y.val <- eval(parse(text=y), envir = parent.frame())
y.val <- .loadServersideObject(y)
.checkClass(obj = y.val, obj_name = y, permitted_classes = c("numeric", "integer", "matrix", "data.frame"))
}
else{
y.val <- NULL
}


if (is.null(y.val) && any(class(x.val) %in% c("numeric", "integer"))) {
stop("If x is a numeric vector, y must also be a numeric vector.", call. = FALSE)
}

# create a data frame for the variables
if (is.null(y.val)){
dataframe <- as.data.frame(x.val)
Expand Down Expand Up @@ -165,7 +174,7 @@ corDS <- function(x=NULL, y=NULL){

}

return(list(sums.of.products=sums.of.products, sums=sums, complete.counts=complete.counts, na.counts=na.counts, sums.of.squares=sums.of.squares))
return(list(sums.of.products=sums.of.products, sums=sums, complete.counts=complete.counts, na.counts=na.counts, sums.of.squares=sums.of.squares, class=class(x.val)))

}
# AGGREGATE FUNCTION
Expand Down
16 changes: 10 additions & 6 deletions R/corTestDS.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,28 @@
#' @param conf.level confidence level for the returned confidence interval. Currently
#' only used for the Pearson product moment correlation coefficient if there are at least
#' 4 complete pairs of observations.
#' @return the results of the correlation test.
#' @return a list with the results of the correlation test and \code{class}, the class of the
#' input object for client-side consistency checking.
#' @author Demetris Avraam, for DataSHIELD Development Team
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' @export
#'
corTestDS <- function(x, y, method, exact, conf.level){

x.var <- eval(parse(text=x), envir = parent.frame())
y.var <- eval(parse(text=y), envir = parent.frame())
x.var <- .loadServersideObject(x)
.checkClass(obj = x.var, obj_name = x, permitted_classes = c("numeric", "integer"))
y.var <- .loadServersideObject(y)
.checkClass(obj = y.var, obj_name = y, permitted_classes = c("numeric", "integer"))

# get the number of pairwise complete cases
n <- sum(stats::complete.cases(x.var, y.var))

# runs a two-sided correlation test
corTest <- stats::cor.test(x=x.var, y=y.var, method=method, exact=exact, conf.level=conf.level)

out <- list(n, corTest)
names(out) <- c("Number of pairwise complete cases", "Correlation test")
out <- list(n, corTest, class = class(x.var))
names(out)[1:2] <- c("Number of pairwise complete cases", "Correlation test")

# return the results
return(out)

Expand Down
19 changes: 14 additions & 5 deletions R/covDS.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
#' of variables is not bigger than a percentage of the individual-level records (the allowed percentage is pre-specified
#' by the 'nfilter.glm'). The second disclosure control checks that none of them is dichotomous with a level having fewer
#' counts than the pre-specified 'nfilter.tab' threshold. If any of the input variables do not pass the disclosure
#' controls then all the output values are replaced with NAs.
#' controls then all the output values are replaced with NAs. The list also includes \code{class}, the class
#' of the input object for client-side consistency checking.
#' @author Amadou Gaye, Paul Burton, and Demetris Avraam for DataSHIELD Development Team
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' @export
#'
covDS <- function(x=NULL, y=NULL, use=NULL){
Expand All @@ -36,14 +38,21 @@ covDS <- function(x=NULL, y=NULL, use=NULL){
#nfilter.string <- as.numeric(thr$nfilter.string)
#############################################################

x.val <- eval(parse(text=x), envir = parent.frame())
x.val <- .loadServersideObject(x)
.checkClass(obj = x.val, obj_name = x, permitted_classes = c("numeric", "integer", "matrix", "data.frame"))

if (!is.null(y)){
y.val <- eval(parse(text=y), envir = parent.frame())
y.val <- .loadServersideObject(y)
.checkClass(obj = y.val, obj_name = y, permitted_classes = c("numeric", "integer", "matrix", "data.frame"))
}
else{
y.val <- NULL
}


if (is.null(y.val) && any(class(x.val) %in% c("numeric", "integer"))) {
stop("If x is a numeric vector, y must also be a numeric vector.", call. = FALSE)
}

# create a data frame for the variables
if (is.null(y.val)){
dataframe <- as.data.frame(x.val)
Expand Down Expand Up @@ -298,7 +307,7 @@ covDS <- function(x=NULL, y=NULL, use=NULL){

}

return(list(sums.of.products=sums.of.products, sums=sums, complete.counts=complete.counts, na.counts=na.counts, errorMessage=errorMessage))
return(list(sums.of.products=sums.of.products, sums=sums, complete.counts=complete.counts, na.counts=na.counts, errorMessage=errorMessage, class=class(x.val)))

}
# AGGREGATE FUNCTION
Expand Down
9 changes: 7 additions & 2 deletions R/dataFrameDS.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#' serverside and named according to the <newobj> argument of the clientside
#' function ds.dataFrame()
#' @author DataSHIELD Development Team
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' @export
#'
dataFrameDS <- function(vectors=NULL, r.names=NULL, ch.rows=FALSE, ch.names=TRUE, clnames=NULL, strAsFactors=TRUE, completeCases=FALSE){
Expand All @@ -58,8 +59,12 @@ dataFrameDS <- function(vectors=NULL, r.names=NULL, ch.rows=FALSE, ch.names=TRUE
r.names <- unlist(r.names)
}

eval.code.vectors.names <- paste0("data.frame(", vectors, ")")
dtemp0 <- eval(parse(text=eval.code.vectors.names), envir = parent.frame())
vectors.names <- unlist(strsplit(vectors, split=","))
loaded.vectors <- vector("list", length(vectors.names))
for(i in seq_along(vectors.names)) {
loaded.vectors[[i]] <- .loadServersideObject(vectors.names[i])
}
dtemp0 <- do.call(data.frame, loaded.vectors)

dtemp <- data.frame(dtemp0, row.names=r.names, check.rows=ch.rows, check.names=ch.names,
stringsAsFactors=strAsFactors)
Expand Down
3 changes: 2 additions & 1 deletion R/dataFrameFillDS.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
#' The classes supported are 'numeric', 'integer', 'character', 'factor' and 'logical'.
#' @return Nothing is returned to the client. The generated object is written to the serverside.
#' @author Demetris Avraam for DataSHIELD Development Team
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' @export
#'
dataFrameFillDS <- function(df.name, allNames.transmit, class.vect.transmit, levels.vec.transmit){

data <- eval(parse(text=df.name), envir = parent.frame())
data <- .loadServersideObject(df.name)

if(!is.null(allNames.transmit)){
allNames <- unlist(strsplit(allNames.transmit, split=","))
Expand Down
6 changes: 3 additions & 3 deletions R/dataFrameSortDS.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#' R environment as a data.frame named according to the <newobj> argument(or with
#' default name 'dataframesort.newobj') if no name is specified
#' @author Paul Burton, with critical error identification by
#' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
#' Leire Abarrategui-Martinez, for DataSHIELD Development Team, 2/4/2020
#' @export
#'
Expand Down Expand Up @@ -65,9 +66,8 @@ dataFrameSortDS <- function(df.name=NULL,sort.key.name=NULL,sort.descending,sort
stop(studysideMessage, call. = FALSE)
}

df.name.2 <- paste0("data.frame(",df.name,")")
df2sort <- eval(parse(text=df.name.2), envir = parent.frame())
sort.key <- eval(parse(text=sort.key.name), envir = parent.frame())
df2sort <- data.frame(.loadServersideObject(df.name))
sort.key <- .loadServersideObject(sort.key.name)

# TYPE CHECK
if(any(class(sort.key) %in% 'factor')){
Expand Down
Loading
Loading