diff --git a/.Rbuildignore b/.Rbuildignore index 561a653e..59863e10 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -9,4 +9,5 @@ ^pkgdown$ ^\.circleci$ ^\.circleci/config\.yml$ -^\.github$ \ No newline at end of file +^\.github$ +^cran-comments\.md$ diff --git a/.github/workflows/dsBase_test_suite.yaml b/.github/workflows/dsBase_test_suite.yaml new file mode 100755 index 00000000..bea80e31 --- /dev/null +++ b/.github/workflows/dsBase_test_suite.yaml @@ -0,0 +1,210 @@ +################################################################################ +# DataSHIELD GHA test suite - dsBase +# Adapted from `azure-pipelines.yml` by Roberto Villegas-Diaz +# +# Inside the root directory $(Pipeline.Workspace) will be a file tree like: +# /dsBase <- Checked out version of datashield/dsBase +# /dsBase/logs <- Where results of tests and logs are collated +# /testStatus <- Checked out version of datashield/testStatus +# +# As of Jul 2025 this takes ~ 9 mins to run. +################################################################################ +name: dsBase tests' suite + +on: + push: + schedule: + - cron: '0 0 * * 0' # Weekly + +jobs: + dsBase_test_suite: + runs-on: ubuntu-latest + timeout-minutes: 120 + permissions: + contents: write + + # These should all be constant, except TEST_FILTER. This can be used to test + # subsets of test files in the testthat directory. Options are like: + # '*' <- Run all tests. + # 'asNumericDS*' <- Run all asNumericDS tests, i.e. all the arg, etc. tests. + # '*_smk_*' <- Run all the smoke tests for all functions. + env: + TEST_FILTER: '*' + _r_check_system_clock_: 0 + WORKFLOW_ID: ${{ github.run_id }}-${{ github.run_attempt }} + PROJECT_NAME: dsBase + BRANCH_NAME: ${{ github.ref_name }} + REPO_OWNER: ${{ github.repository_owner }} + R_KEEP_PKG_SOURCE: yes + GITHUB_TOKEN: ${{ github.token || 'placeholder-token' }} + + steps: + - name: Checkout dsBase + uses: actions/checkout@v4 + with: + path: dsBase + + - name: Checkout testStatus + if: ${{ github.actor != 'nektos/act' }} # for local deployment only + uses: actions/checkout@v4 + with: + repository: ${{ env.REPO_OWNER }}/testStatus + ref: master + path: testStatus + persist-credentials: false + token: ${{ env.GITHUB_TOKEN }} + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: release + http-user-agent: release + use-public-rspm: true + + - name: Install dsBase + run: | + Rscript -e 'install.packages(c("RANN", "stringr", "lme4", "dplyr", "reshape2", "polycor", "gamlss", "gamlss.dist", "mice", "childsds", "usethis", "devtools"), dependencies = TRUE)' + R CMD INSTALL ./dsBase + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + dependencies: 'c("Imports")' + extra-packages: | + any::rcmdcheck + cran::devtools + cran::git2r + cran::RCurl + cran::readr + cran::magrittr + cran::xml2 + cran::purrr + cran::dplyr + cran::stringr + cran::tidyr + cran::quarto + cran::knitr + cran::kableExtra + cran::rmarkdown + cran::downlit + needs: check + + - name: Check man files up-to-date + run: | + orig_sum=$(find man -type f | sort -u | xargs cat | md5sum) + R -e "devtools::document()" + new_sum=$(find man -type f | sort -u | xargs cat | md5sum) + if [ "$orig_sum" != "$new_sum" ]; then + echo "Your committed manual files (man/*.Rd) are out of sync with the R files. Run devtools::document() locally then commit." + exit 1 + else + echo "Documentation up-to-date." + fi + working-directory: dsBase + continue-on-error: true + + - name: Run devtools::check + run: | + R -q -e "library('devtools'); devtools::check(args = c('--no-tests', '--no-examples'))" | tee ../check.Rout + grep -q "^0 errors" ../check.Rout && grep -q " 0 warnings" ../check.Rout && grep -q " 0 notes" ../check.Rout + working-directory: dsBase + continue-on-error: true + + - name: Run tests with coverage & JUnit report + run: | + mkdir -p logs + R -q -e "devtools::reload();" + R -q -e ' + write.csv( + covr::coverage_to_list( + covr::package_coverage( + type = c("none"), + code = c('"'"' + output_file <- file("test_console_output.txt"); + sink(output_file); + sink(output_file, type = "message"); + junit_rep <- testthat::JunitReporter$new(file = file.path(getwd(), "test_results.xml")); + progress_rep <- testthat::ProgressReporter$new(max_failures = 999999); + multi_rep <- testthat::MultiReporter$new(reporters = list(progress_rep, junit_rep)); + testthat::test_package("${{ env.PROJECT_NAME }}", filter = "${{ env.TEST_FILTER }}", reporter = multi_rep, stop_on_failure = FALSE)'"'"' + ) + ) + ), + "coveragelist.csv" + )' + + mv coveragelist.csv logs/ + mv test_* logs/ + grep -q " FAIL 0 " logs/test_console_output.txt + working-directory: dsBase + + - name: Check for JUnit errors + run: | + issue_count=$(sed 's/failures="0" errors="0"//' test_results.xml | grep -c errors= || true) + echo "Number of testsuites with issues: $issue_count" + sed 's/failures="0" errors="0"//' test_results.xml | grep errors= > issues.log || true + cat issues.log || true + exit $issue_count + working-directory: dsBase/logs + + - name: Write versions to file + run: | + 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/ 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 }}/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 }}/latest/index.html + + env: + PROJECT_NAME: ${{ env.PROJECT_NAME }} + BRANCH_NAME: ${{ env.BRANCH_NAME }} + WORKFLOW_ID: ${{ env.WORKFLOW_ID }} + + - name: Upload test logs + uses: actions/upload-artifact@v4 + with: + name: dsbase-logs + path: testStatus/new + + - name: Dump environment info + run: | + echo -e "\n#############################" + echo -e "ls /: ######################" + ls -al . + echo -e "\n#############################" + echo -e "lscpu: ######################" + lscpu + echo -e "\n#############################" + echo -e "memory: #####################" + free -m + echo -e "\n#############################" + echo -e "env: ########################" + env + echo -e "\n#############################" + echo -e "R sessionInfo(): ############" + R -e 'sessionInfo()' + sudo apt install tree -y + tree . + diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 00000000..bfc9f4db --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,49 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + release: + types: [published] + workflow_dispatch: + +name: pkgdown.yaml + +permissions: read-all + +jobs: + pkgdown: + runs-on: ubuntu-latest + # Only restrict concurrency for non-PR jobs + concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, local::. + needs: website + + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + shell: Rscript {0} + + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.5.0 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 00000000..0ab748d6 --- /dev/null +++ b/.github/workflows/test-coverage.yaml @@ -0,0 +1,62 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + +name: test-coverage.yaml + +permissions: read-all + +jobs: + test-coverage: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::covr, any::xml2 + needs: coverage + + - name: Test coverage + run: | + cov <- covr::package_coverage( + quiet = FALSE, + clean = FALSE, + install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") + ) + print(cov) + covr::to_cobertura(cov) + shell: Rscript {0} + + - uses: codecov/codecov-action@v5 + with: + # Fail if error if not on PR, or if on PR and token is given + fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }} + files: ./cobertura.xml + plugins: noop + disable_search: true + token: ${{ secrets.CODECOV_TOKEN }} + + - name: Show testthat output + if: always() + run: | + ## -------------------------------------------------------------------- + find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true + shell: bash + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v4 + with: + name: coverage-test-failures + path: ${{ runner.temp }}/package diff --git a/DESCRIPTION b/DESCRIPTION index 3943a07f..bc5e3973 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,23 +1,27 @@ Package: dsBase -Title: 'DataSHIELD' Server Site Base Functions +Title: 'DataSHIELD' Server Side Base Functions Description: Base 'DataSHIELD' functions for the server side. 'DataSHIELD' is a software package which allows you to do non-disclosive federated analysis on sensitive data. 'DataSHIELD' analytic functions have been designed to only share non disclosive summary statistics, with built in automated output checking based on statistical disclosure control. With data sites setting the threshold values for - the automated output checks. -Version: 6.3.3 + the automated output checks. For more details, see 'citation("dsBase")'. +Version: 6.3.5.9000 Authors@R: c(person(given = "Paul", family = "Burton", - role = c("aut")), + role = c("aut"), + comment = c(ORCID = "0000-0001-5799-9634")), person(given = "Rebecca", family = "Wilson", - role = c("aut")), + role = c("aut"), + comment = c(ORCID = "0000-0003-2294-593X")), person(given = "Olly", family = "Butters", - role = c("aut")), + role = c("aut"), + comment = c(ORCID = "0000-0003-0354-8461")), person(given = "Patricia", family = "Ryser-Welch", - role = c("aut")), + role = c("aut"), + comment = c(ORCID = "0000-0002-0070-0264")), person(given = "Alex", family = "Westerberg", role = c("aut")), @@ -37,6 +41,17 @@ Authors@R: c(person(given = "Paul", role = c("aut"), email = "yannick.marcon@obiba.org", comment = c(ORCID = "0000-0003-0138-2023")), + person(given = "Tom", + family = "Bishop", + role = c("aut")), + person(given = "Amadou", + family = "Gaye", + role = c("aut"), + comment = c(ORCID = "0000-0002-1180-2792")), + person(given = "Xavier", + family = "Escribà-Montagut", + role = c("aut"), + comment = c(ORCID = "0000-0003-2888-8948")), person(given = "Stuart", family = "Wheater", role = c("aut", "cre"), @@ -58,6 +73,8 @@ Imports: mice, childsds Suggests: + spelling, testthat -RoxygenNote: 7.3.2 +RoxygenNote: 7.3.3 Encoding: UTF-8 +Language: en-GB diff --git a/NAMESPACE b/NAMESPACE index 897148d1..e52e5d10 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -82,6 +82,7 @@ export(matrixDimnamesDS) export(matrixInvertDS) export(matrixMultDS) export(matrixTransposeDS) +export(mdPatternDS) export(meanDS) export(meanSdGpDS) export(mergeDS) diff --git a/R/BooleDS.R b/R/BooleDS.R index 1ad5e14f..0f54dfca 100644 --- a/R/BooleDS.R +++ b/R/BooleDS.R @@ -28,7 +28,7 @@ BooleDS <- function(V1.name=NULL, V2.name=NULL, Boolean.operator.n=NULL, na.assign.text, numeric.output=TRUE){ # Check Permissive Privacy Control Level. - dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana')) + dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana', 'carrot')) ######################################################################### # DataSHIELD MODULE: CAPTURE THE nfilter SETTINGS # diff --git a/R/asDataMatrixDS.R b/R/asDataMatrixDS.R index 5b4e5d71..3fff528b 100644 --- a/R/asDataMatrixDS.R +++ b/R/asDataMatrixDS.R @@ -3,7 +3,7 @@ #' class for all columns in data.frames. #' @details This assign function is based on the native R function \code{data.matrix} #' If applied to a data.frame, the native R function \code{as.matrix} -#' coverts all columns into character class. In contrast, if applied to +#' converts all columns into character class. In contrast, if applied to #' a data.frame the native R function \code{data.matrix} converts #' the data.frame to a matrix but maintains all data columns in their #' original class diff --git a/R/blackBoxDS.R b/R/blackBoxDS.R index 8e7e33f1..63cf0160 100644 --- a/R/blackBoxDS.R +++ b/R/blackBoxDS.R @@ -67,8 +67,11 @@ blackBoxDS <- function(input.var.name=NULL, ######################################################## # back-up current .Random.seed and revert on.exit - old_seed <- .Random.seed - on.exit(.Random.seed <- old_seed, add = TRUE) + if (exists(x = ".Random.seed", envir = globalenv())) { + assign(x = ".old_seed", value = .Random.seed, envir = parent.frame()); + on.exit({ assign(x = ".Random.seed", value = parent.frame()$.old_seed, envir = globalenv()); remove(".old_seed", envir = parent.frame()) }, add = TRUE) + } else + on.exit(if (exists(x = ".Random.seed", envir = globalenv())) remove(".Random.seed", envir = globalenv()), add = TRUE) input.var <- eval(parse(text=input.var.name), envir = parent.frame()) diff --git a/R/blackBoxRanksDS.R b/R/blackBoxRanksDS.R index cb2fc21f..522307a8 100644 --- a/R/blackBoxRanksDS.R +++ b/R/blackBoxRanksDS.R @@ -62,8 +62,11 @@ blackBoxRanksDS <- function(input.var.name=NULL, shared.seedval){ #START FUNC ######################################################## # back-up current .Random.seed and revert on.exit - old_seed <- .Random.seed - on.exit(.Random.seed <- old_seed, add = TRUE) + if (exists(x = ".Random.seed", envir = globalenv())) { + assign(x = ".old_seed", value = .Random.seed, envir = parent.frame()); + on.exit({ assign(x = ".Random.seed", value = parent.frame()$.old_seed, envir = globalenv()); remove(".old_seed", envir = parent.frame()) }, add = TRUE) + } else + on.exit(if (exists(x = ".Random.seed", envir = globalenv())) remove(".Random.seed", envir = globalenv()), add = TRUE) input.var <- eval(parse(text=input.var.name), envir = parent.frame()) input.global.ranks<-input.var diff --git a/R/cbindDS.R b/R/cbindDS.R index 5d5464e7..b7864864 100644 --- a/R/cbindDS.R +++ b/R/cbindDS.R @@ -24,7 +24,7 @@ cbindDS <- function(x.names.transmit=NULL, colnames.transmit=NULL){ # Check Permissive Privacy Control Level. - dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana')) + dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana', 'carrot')) x.names.input <- x.names.transmit x.names.act1 <- unlist(strsplit(x.names.input, split=",")) diff --git a/R/checkNegValueDS.R b/R/checkNegValueDS.R index 3f46f3fa..48629138 100644 --- a/R/checkNegValueDS.R +++ b/R/checkNegValueDS.R @@ -1,7 +1,7 @@ #' #' @title Checks if a numeric variable has negative values #' @description this function is only called by the client function \code{ds.glm}. -#' @details if a user sets the parameter 'weights' on the client site function \code{ds.glm} this +#' @details if a user sets the parameter 'weights' on the client side function \code{ds.glm} this #' server side function is called to verify that the 'weights' vector does not have negative values #' because no negative are allowed in weights. #' @param weights a numeric vector diff --git a/R/dataFrameDS.R b/R/dataFrameDS.R index a3e06f4c..7a2b36be 100644 --- a/R/dataFrameDS.R +++ b/R/dataFrameDS.R @@ -40,7 +40,7 @@ dataFrameDS <- function(vectors=NULL, r.names=NULL, ch.rows=FALSE, ch.names=TRUE, clnames=NULL, strAsFactors=TRUE, completeCases=FALSE){ # Check Permissive Privacy Control Level. - dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana')) + dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana', 'carrot')) ######################################################################### # DataSHIELD MODULE: CAPTURE THE nfilter SETTINGS diff --git a/R/dataFrameSortDS.R b/R/dataFrameSortDS.R index 0ea3b3c1..a398a70b 100644 --- a/R/dataFrameSortDS.R +++ b/R/dataFrameSortDS.R @@ -36,7 +36,7 @@ dataFrameSortDS <- function(df.name=NULL,sort.key.name=NULL,sort.descending,sort.method){ # Check Permissive Privacy Control Level. - dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana')) + dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana', 'carrot')) ######################################################################### # DataSHIELD MODULE: CAPTURE THE nfilter SETTINGS diff --git a/R/dataFrameSubsetDS1.R b/R/dataFrameSubsetDS1.R index 232e405c..4b3c9476 100644 --- a/R/dataFrameSubsetDS1.R +++ b/R/dataFrameSubsetDS1.R @@ -50,7 +50,7 @@ dataFrameSubsetDS1 <- function(df.name=NULL,V1.name=NULL,V2.name=NULL,Boolean.operator.n=NULL,keep.cols=NULL,rm.cols=NULL,keep.NAs=NULL){ # Check Permissive Privacy Control Level. - dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana')) + dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana', 'carrot')) ######################################################################### # DataSHIELD MODULE: CAPTURE THE nfilter SETTINGS diff --git a/R/dataFrameSubsetDS2.R b/R/dataFrameSubsetDS2.R index 3a59602f..05938a60 100644 --- a/R/dataFrameSubsetDS2.R +++ b/R/dataFrameSubsetDS2.R @@ -59,7 +59,7 @@ dataFrameSubsetDS2<-function(df.name=NULL,V1.name=NULL, V2.name=NULL, Boolean.operator.n=NULL,keep.cols=NULL, rm.cols=NULL, keep.NAs=NULL){ # Check Permissive Privacy Control Level. - dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana')) + dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana', 'carrot')) ######################################################################### # DataSHIELD MODULE: CAPTURE THE nfilter SETTINGS # diff --git a/R/densityGridDS.R b/R/densityGridDS.R index 786302f7..1569d5c1 100644 --- a/R/densityGridDS.R +++ b/R/densityGridDS.R @@ -1,6 +1,6 @@ #' #' @title Generates a density grid with or without a priori defined limits -#' @description Generates a density grid that can then be used for heatmap or countour plots. +#' @description Generates a density grid that can then be used for heatmap or contour plots. #' @details Invalid cells (cells with count < to the set filter value for the minimum allowed #' counts in table cells) are turn to 0. #' @param xvect a numerical vector diff --git a/R/dmtC2SDS.R b/R/dmtC2SDS.R index 5d315e3d..9b4329ad 100644 --- a/R/dmtC2SDS.R +++ b/R/dmtC2SDS.R @@ -22,10 +22,10 @@ #' @param ncols.transmit specifies the number of columns in the matrix to be created. #' Fixed by the clientside function as equal to the number of columns in #' the clientside DMT to be transferred. -#' @param colnames.transmit a parser-transmissable vector specifying the name of each column +#' @param colnames.transmit a parser-transmissible vector specifying the name of each column #' in the DMT being transferred from clientside to serverside. #' Generated automatically by clientside function from colnames of clientside DMT. -#' @param colclass.transmit a parser-transmissable vector specifying the class of the +#' @param colclass.transmit a parser-transmissible vector specifying the class of the #' vector representing each individual column in the DMT to be transferred. #' Generated automatically by clientside function. This allows the transmission of DMTs #' containing columns with different classes.If something is going to go wrong with diff --git a/R/dsBase-package.R b/R/dsBase-package.R new file mode 100644 index 00000000..a65cf643 --- /dev/null +++ b/R/dsBase-package.R @@ -0,0 +1,6 @@ +#' @keywords internal +"_PACKAGE" + +## usethis namespace: start +## usethis namespace: end +NULL diff --git a/R/gamlssDS.R b/R/gamlssDS.R index 322f0661..533da0e1 100644 --- a/R/gamlssDS.R +++ b/R/gamlssDS.R @@ -1,5 +1,5 @@ #' -#' @title gamlssDS an aggregate function called by ds.galmss +#' @title gamlssDS an aggregate function called by ds.gamlss #' @description This function calls the gamlssDS that is a wrapper function from #' the gamlss R package. The function returns an object of class "gamlss", which #' is a generalized additive model for location, scale and shape (GAMLSS). The diff --git a/R/glmerSLMADS.assign.R b/R/glmerSLMADS.assign.R index 9e39c72b..df367ea1 100644 --- a/R/glmerSLMADS.assign.R +++ b/R/glmerSLMADS.assign.R @@ -5,7 +5,7 @@ #' The analytic work engine is the glmer function in R which sits in the lme4 package. #' glmerSLMADS.assign fits a generalized linear mixed effects model (glme) - e.g. a logistic or #' Poisson regression model including both fixed and random effects - on data -#' from each single data source and saves the regression outcomes on the serveside. +#' from each single data source and saves the regression outcomes on the serverside. #' @param formula see help for ds.glmerSLMA #' @param offset see help for ds.glmerSLMA #' @param weights see help for ds.glmerSLMA diff --git a/R/global.R b/R/global.R index 89970bc0..a3c9454e 100644 --- a/R/global.R +++ b/R/global.R @@ -2,5 +2,4 @@ utils::globalVariables(c('offset.to.use', 'weights.to.use', 'out.table.real', 'out.table.dim', 'out.table.dimnames', 'list.obj', 'mg', 'blackbox.output.df', 'blackbox.ranks.df', 'global.bounds.df', 'global.ranks.quantiles.df', 'sR4.df', - 'min.max.df','sR5.df','input.mean.sd.df','input.ranks.sd.df','RS','CG','mixed', 'x','y')) - + 'min.max.df','sR5.df','input.mean.sd.df','input.ranks.sd.df','RS','CG','mixed','x','y','.old_seed','.Random.seed')) diff --git a/R/heatmapPlotDS.R b/R/heatmapPlotDS.R index 6dccbd5b..349f57b9 100644 --- a/R/heatmapPlotDS.R +++ b/R/heatmapPlotDS.R @@ -39,8 +39,11 @@ heatmapPlotDS <- function(x, y, k, noise, method.indicator){ ################################################################### # back-up current .Random.seed and revert on.exit - old_seed <- .Random.seed - on.exit(.Random.seed <- old_seed, add = TRUE) + if (exists(x = ".Random.seed", envir = globalenv())) { + assign(x = ".old_seed", value = .Random.seed, envir = parent.frame()); + on.exit({ assign(x = ".Random.seed", value = parent.frame()$.old_seed, envir = globalenv()); remove(".old_seed", envir = parent.frame()) }, add = TRUE) + } else + on.exit(if (exists(x = ".Random.seed", envir = globalenv())) remove(".Random.seed", envir = globalenv()), add = TRUE) # Cbind the columns of the two variables and remove any rows that include NAs data.table <- cbind.data.frame(x, y) diff --git a/R/hetcorDS.R b/R/hetcorDS.R index 3cf57366..d561ce30 100644 --- a/R/hetcorDS.R +++ b/R/hetcorDS.R @@ -1,7 +1,7 @@ #' #' @title Heterogeneous Correlation Matrix #' @description This function is based on the hetcor function from the R package \code{polycor}. -#' @details Computes a heterogenous correlation matrix, consisting of Pearson product-moment +#' @details Computes a heterogeneous correlation matrix, consisting of Pearson product-moment #' correlations between numeric variables, polyserial correlations between numeric and ordinal #' variables, and polychoric correlations between ordinal variables. #' @param data the name of a data frame consisting of factors, ordered factors, logical variables, diff --git a/R/histogramDS1.R b/R/histogramDS1.R index a79d2f52..71ffc439 100644 --- a/R/histogramDS1.R +++ b/R/histogramDS1.R @@ -37,8 +37,11 @@ histogramDS1 <- function(xvect, method.indicator, k, noise){ ################################################################## # back-up current .Random.seed and revert on.exit - old_seed <- .Random.seed - on.exit(.Random.seed <- old_seed, add = TRUE) + if (exists(x = ".Random.seed", envir = globalenv())) { + assign(x = ".old_seed", value = .Random.seed, envir = parent.frame()); + on.exit({ assign(x = ".Random.seed", value = parent.frame()$.old_seed, envir = globalenv()); remove(".old_seed", envir = parent.frame()) }, add = TRUE) + } else + on.exit(if (exists(x = ".Random.seed", envir = globalenv())) remove(".Random.seed", envir = globalenv()), add = TRUE) # print an error message if the input vector is not a numeric if(!(is.numeric(xvect))){ diff --git a/R/histogramDS2.R b/R/histogramDS2.R index 1f7a8acc..001ab0dd 100644 --- a/R/histogramDS2.R +++ b/R/histogramDS2.R @@ -39,8 +39,11 @@ histogramDS2 <- function (xvect, num.breaks, min, max, method.indicator, k, nois ################################################################## # back-up current .Random.seed and revert on.exit - old_seed <- .Random.seed - on.exit(.Random.seed <- old_seed, add = TRUE) + if (exists(x = ".Random.seed", envir = globalenv())) { + assign(x = ".old_seed", value = .Random.seed, envir = parent.frame()); + on.exit({ assign(x = ".Random.seed", value = parent.frame()$.old_seed, envir = globalenv()); remove(".old_seed", envir = parent.frame()) }, add = TRUE) + } else + on.exit(if (exists(x = ".Random.seed", envir = globalenv())) remove(".Random.seed", envir = globalenv()), add = TRUE) if (method.indicator==1){ diff --git a/R/levelsDS.R b/R/levelsDS.R index 9bb54401..bdb374d5 100644 --- a/R/levelsDS.R +++ b/R/levelsDS.R @@ -10,7 +10,7 @@ levelsDS <- function(x){ # Check Permissive Privacy Control Level. - dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana')) + dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana', 'carrot')) ################################################################## #MODULE 1: CAPTURE THE nfilter SETTINGS # diff --git a/R/lexisDS2.R b/R/lexisDS2.R index e4c08117..d63989d2 100644 --- a/R/lexisDS2.R +++ b/R/lexisDS2.R @@ -3,7 +3,7 @@ #' @description The second serverside function called by ds.lexis. #' @details This is the assign #' function which actually creates -#' the expanded dataframe containing surival data for a piecewise exponential +#' the expanded dataframe containing survival data for a piecewise exponential #' regression. lexisDS2 also #' carries out a series of disclosure checks and if the arguments or data fail any of #' those tests, diff --git a/R/lmerSLMADS.assign.R b/R/lmerSLMADS.assign.R index 526818a1..06b2bcd1 100644 --- a/R/lmerSLMADS.assign.R +++ b/R/lmerSLMADS.assign.R @@ -1,10 +1,10 @@ #' @title Fitting linear mixed effect models - serverside function -#' @description lmerSLMADS.assing is the same as lmerSLMADS2 which fits a linear +#' @description lmerSLMADS.assign is the same as lmerSLMADS2 which fits a linear #' mixed effects model (lme) per study and saves the outcomes in each study #' @details lmerSLMADS.assign is a serverside function called by ds.lmerSLMA on the clientside. #' The analytic work engine is the lmer function in R which sits in the lme4 package. #' lmerSLMADS.assign fits a linear mixed effects model (lme) including both fixed and random -#' effects - on data from each single data source and saves the regression outcomes on the serveside. +#' effects - on data from each single data source and saves the regression outcomes on the serverside. #' @param formula see help for ds.lmerSLMA #' @param offset see help for ds.lmerSLMA #' @param weights see help for ds.lmerSLMA diff --git a/R/mdPatternDS.R b/R/mdPatternDS.R new file mode 100644 index 00000000..0f817034 --- /dev/null +++ b/R/mdPatternDS.R @@ -0,0 +1,121 @@ +#' +#' @title Missing data pattern with disclosure control +#' @description This function is a serverside aggregate function that computes the +#' missing data pattern using mice::md.pattern and applies disclosure control to +#' prevent revealing small cell counts. +#' @details This function calls the mice::md.pattern function to generate a matrix +#' showing the missing data patterns in the input data. To ensure disclosure control, +#' any pattern counts that are below the threshold (nfilter.tab, default=3) are +#' suppressed. +#' +#' \strong{Suppression Method:} +#' +#' When a pattern count is below threshold: +#' - Row name is changed to "suppressed()" where N is the threshold +#' - All pattern values in that row are set to NA +#' - Summary row is also set to NA (prevents back-calculation) +#' +#' \strong{Output Matrix Structure:} +#' +#' - Rows represent different missing data patterns (plus a summary row at the bottom) +#' - Row names contain pattern counts (or "suppressed()" for invalid patterns) +#' - Columns show 1 if variable is observed, 0 if missing +#' - Last column shows total number of missing values per pattern +#' - Last row shows total number of missing values per variable +#' +#' \strong{Note for Pooling:} +#' +#' When this function is called from ds.mdPattern with type='combine', suppressed +#' patterns are excluded from pooling to prevent disclosure through subtraction. +#' This means pooled counts may underestimate the true total when patterns are +#' suppressed in some studies. +#' +#' @param x a character string specifying the name of a data frame or matrix +#' containing the data to analyze for missing patterns. +#' @return A list containing: +#' \item{pattern}{The missing data pattern matrix with disclosure control applied} +#' \item{valid}{Logical indicating if all patterns meet disclosure requirements} +#' \item{message}{A message describing the validity status} +#' @author Xavier Escribà montagut for DataSHIELD Development Team +#' @import mice +#' @export +#' +mdPatternDS <- function(x){ + + ############################################################# + # MODULE 1: CAPTURE THE nfilter SETTINGS + thr <- dsBase::listDisclosureSettingsDS() + nfilter.tab <- as.numeric(thr$nfilter.tab) + ############################################################# + + # Parse the input data name with error handling + x.val <- tryCatch( + { + eval(parse(text=x), envir = parent.frame()) + }, + error = function(e) { + stop(paste0("Object '", x, "' does not exist on the server"), call. = FALSE) + } + ) + + # Check object class + typ <- class(x.val) + + # Check that input is a data frame or matrix + if(!("data.frame" %in% typ || "matrix" %in% typ)){ + stop(paste0("The input object must be of type 'data.frame' or 'matrix'. Current type: ", + paste(typ, collapse = ", ")), call. = FALSE) + } + + # Use x.val for further processing + x <- x.val + + # Call mice::md.pattern with plot=FALSE + pattern <- mice::md.pattern(x, plot = FALSE) + + # Apply disclosure control + # Pattern counts are stored in row names (except last row which is empty/summary) + # The last row contains variable-level missing counts + + validity <- "valid" + n_patterns <- nrow(pattern) - 1 # exclude the summary row + + if(n_patterns > 0){ + # Check pattern counts (stored in row names, excluding last row) + pattern_counts <- as.numeric(rownames(pattern)[1:n_patterns]) + + # Find patterns with counts below threshold + invalid_idx <- which(pattern_counts > 0 & pattern_counts < nfilter.tab) + + if(length(invalid_idx) > 0){ + validity <- "invalid" + + # For invalid patterns, suppress by: + # - Setting row name to "suppressed" + # - Setting all pattern values to NA + rnames <- rownames(pattern) + for(idx in invalid_idx){ + rnames[idx] <- paste0("suppressed(<", nfilter.tab, ")") + pattern[idx, ] <- NA + } + rownames(pattern) <- rnames + + # Also need to recalculate the last row (summary) if patterns were suppressed + # Set to NA to avoid disclosures + pattern[nrow(pattern), seq_len(ncol(pattern))] <- NA + } + } + + # Return the pattern with validity information + return(list( + pattern = pattern, + valid = (validity == "valid"), + message = ifelse(validity == "valid", + "Valid: all pattern counts meet disclosure requirements", + paste0("Invalid: some pattern counts below threshold (", + nfilter.tab, ") have been suppressed")) + )) +} + +#AGGREGATE FUNCTION +# mdPatternDS diff --git a/R/meanDS.R b/R/meanDS.R index b186b4a9..59d1bc4e 100644 --- a/R/meanDS.R +++ b/R/meanDS.R @@ -1,5 +1,5 @@ #' -#' @title Computes statistical mean of a vectores +#' @title Computes statistical mean of a vector #' @description Calculates the mean value. #' @details if the length of input vector is less than the set filter #' a missing value is returned. diff --git a/R/metadataDS.R b/R/metadataDS.R index 3a478d48..a416ed61 100644 --- a/R/metadataDS.R +++ b/R/metadataDS.R @@ -4,7 +4,7 @@ #' @details The function returns the metadata, obtained from attributes function. #' @param x a string character, containing the name of the specified variable #' @return a list containing the metadata. The elements of the list will depend -#' on the meatadata available. +#' on the metadata available. #' @author Stuart Wheater, for DataSHIELD Development Team #' @export #' diff --git a/R/minMaxRandDS.R b/R/minMaxRandDS.R index 0346eb75..64caf7ae 100644 --- a/R/minMaxRandDS.R +++ b/R/minMaxRandDS.R @@ -21,8 +21,11 @@ minMaxRandDS <- function(input.var.name){ #START FUNC # back-up current .Random.seed and revert on.exit - old_seed <- .Random.seed - on.exit(.Random.seed <- old_seed, add = TRUE) + if (exists(x = ".Random.seed", envir = globalenv())) { + assign(x = ".old_seed", value = .Random.seed, envir = parent.frame()); + on.exit({ assign(x = ".Random.seed", value = parent.frame()$.old_seed, envir = globalenv()); remove(".old_seed", envir = parent.frame()) }, add = TRUE) + } else + on.exit(if (exists(x = ".Random.seed", envir = globalenv())) remove(".Random.seed", envir = globalenv()), add = TRUE) input.var <- eval(parse(text=input.var.name), envir = parent.frame()) diff --git a/R/qlsplineDS.R b/R/qlsplineDS.R index 7b9d5e4b..3df267f8 100644 --- a/R/qlsplineDS.R +++ b/R/qlsplineDS.R @@ -15,7 +15,7 @@ #' probabilities directly (the vector is passed to argument probs of quantile). #' @param x the name of the input numeric variable #' @param q numeric, a single scalar greater or equal to 2 for a number of equal-frequency -#' intervals along x or a vector of numbers in (0; 1) specifying the quantiles explicitely. +#' intervals along x or a vector of numbers in (0; 1) specifying the quantiles explicitly. #' @param na.rm logical, whether NA should be removed when calculating quantiles, passed #' to na.rm of quantile. Default set to TRUE. #' @param marginal logical, how to parametrize the spline, see Details diff --git a/R/rangeDS.R b/R/rangeDS.R index 6cf7689c..ec9183ea 100644 --- a/R/rangeDS.R +++ b/R/rangeDS.R @@ -9,8 +9,11 @@ #' rangeDS <- function(xvect) { # back-up current .Random.seed and revert on.exit - old_seed <- .Random.seed - on.exit(.Random.seed <- old_seed, add = TRUE) + if (exists(x = ".Random.seed", envir = globalenv())) { + assign(x = ".old_seed", value = .Random.seed, envir = parent.frame()); + on.exit({ assign(x = ".Random.seed", value = parent.frame()$.old_seed, envir = globalenv()); remove(".old_seed", envir = parent.frame()) }, add = TRUE) + } else + on.exit(if (exists(x = ".Random.seed", envir = globalenv())) remove(".Random.seed", envir = globalenv()), add = TRUE) # print an error message if the input vector is not a numeric if (!(is.numeric(xvect))) { diff --git a/R/reShapeDS.R b/R/reShapeDS.R index 6dbf0654..2ec368a5 100644 --- a/R/reShapeDS.R +++ b/R/reShapeDS.R @@ -43,7 +43,7 @@ reShapeDS <- function(data.name, varying.transmit, v.names.transmit, timevar.name, idvar.name, drop.transmit, direction, sep){ # Check Permissive Privacy Control Level. - dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana')) + dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana', 'carrot')) datatext <- paste0("data.frame(",data.name,")") data <- eval(parse(text=datatext), envir = parent.frame()) diff --git a/R/recodeLevelsDS.R b/R/recodeLevelsDS.R index c773e774..6878faa6 100644 --- a/R/recodeLevelsDS.R +++ b/R/recodeLevelsDS.R @@ -11,7 +11,7 @@ recodeLevelsDS <- function (x=NULL, classes=NULL){ # Check Permissive Privacy Control Level. - dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana')) + dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana', 'carrot')) # check if the input vector is valid (i.e. meets DataSHIELD criteria) check <- isValidDS(x) diff --git a/R/recodeValuesDS.R b/R/recodeValuesDS.R index f29dc0fa..d22a7862 100644 --- a/R/recodeValuesDS.R +++ b/R/recodeValuesDS.R @@ -31,7 +31,7 @@ recodeValuesDS <- function(var.name.text=NULL, values2replace.text=NULL, new.values.text=NULL, missing=NULL){ # Check Permissive Privacy Control Level. - dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana')) + dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana', 'carrot')) ############################################################# #MODULE 1: CAPTURE THE used nfilter SETTINGS diff --git a/R/repDS.R b/R/repDS.R index 4dd8a94f..61b4e3ea 100644 --- a/R/repDS.R +++ b/R/repDS.R @@ -41,7 +41,7 @@ #' help for " (see above). This parameter is usually fully defined by #' the argument in the call to \code{ds.rep} that itself calls \code{repDS}. #' @param length.out.transmit This argument fixes the length of -#' the output repetive sequence vector +#' the output repetitive sequence vector #' For behaviour see help for \code{ds.rep} and "details from native R #' help for " (see above). This parameter is usually fully defined by #' the argument in the call to \code{ds.rep} that itself calls \code{repDS}. diff --git a/R/rmDS.R b/R/rmDS.R index d7e4741d..04a3b1e1 100644 --- a/R/rmDS.R +++ b/R/rmDS.R @@ -9,7 +9,7 @@ #' fail because the effect of the function is to delete the object and so #' it would be impossible to write it anywhere. #' @param x.names.transmit, the names of the objects to be deleted converted -#' into transmissable form, a comma seperated list of character string. The +#' into transmissible form, a comma separated list of character string. The #' argument is specified via the argument of ds.rm #' @return the specified object is deleted from the serverside. If this #' is successful the message "Object successfully deleted" is returned diff --git a/R/scatterPlotDS.R b/R/scatterPlotDS.R index bf229041..ab48be10 100644 --- a/R/scatterPlotDS.R +++ b/R/scatterPlotDS.R @@ -44,8 +44,11 @@ scatterPlotDS <- function(x, y, method.indicator, k, noise){ ################################################################### # back-up current .Random.seed and revert on.exit - old_seed <- .Random.seed - on.exit(.Random.seed <- old_seed, add = TRUE) + if (exists(x = ".Random.seed", envir = globalenv())) { + assign(x = ".old_seed", value = .Random.seed, envir = parent.frame()); + on.exit({ assign(x = ".Random.seed", value = parent.frame()$.old_seed, envir = globalenv()); remove(".old_seed", envir = parent.frame()) }, add = TRUE) + } else + on.exit(if (exists(x = ".Random.seed", envir = globalenv())) remove(".Random.seed", envir = globalenv()), add = TRUE) # Cbind the columns of the two variables and remove any rows that include NAs data.table <- cbind.data.frame(x, y) diff --git a/R/subsetByClassDS.R b/R/subsetByClassDS.R index f213bb4d..e4063482 100644 --- a/R/subsetByClassDS.R +++ b/R/subsetByClassDS.R @@ -18,7 +18,7 @@ subsetByClassDS <- function(data=NULL, variables=NULL){ # Check Permissive Privacy Control Level. - dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana')) + dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana', 'carrot')) # this filter sets the minimum number of observations that are allowed diff --git a/R/subsetDS.R b/R/subsetDS.R index 7ba57ac2..2ab0a14c 100644 --- a/R/subsetDS.R +++ b/R/subsetDS.R @@ -30,7 +30,7 @@ subsetDS <- function(dt=NULL, complt=NULL, rs=NULL, cs=NULL, lg=NULL, th=NULL, varname=NULL){ # Check Permissive Privacy Control Level. - dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana')) + dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana', 'carrot')) # this filter sets the minimum number of observations that are allowed diff --git a/R/table1DDS.R b/R/table1DDS.R index d73e3867..94bff957 100644 --- a/R/table1DDS.R +++ b/R/table1DDS.R @@ -5,7 +5,7 @@ #' @details It generates a 1-dimensional tables where valid (non-disclosive) 1-dimensional tables are defined #' as data from sources where no table cells have counts between 1 and the set threshold. When the output table #' is invalid all cells but the total count are replaced by missing values. Only the total count is visible -#' on the table returned to the client site. A message is also returned with the 1-dimensional; the message +#' on the table returned to the client side. A message is also returned with the 1-dimensional; the message #' says "invalid table - invalid counts present" if the table is invalid and 'valid table' otherwise. #' @param xvect a numerical vector with discrete values - usually a factor. #' @return a list which contains two elements: 'table', the 1-dimensional table and 'message' a message which diff --git a/R/tableDS.R b/R/tableDS.R index c9e9d621..c190ffc3 100644 --- a/R/tableDS.R +++ b/R/tableDS.R @@ -6,15 +6,15 @@ #' the table requested in the format specified by \code{ds.table}. For more #' information see help for \code{ds.table} in DataSHIELD and the \code{table} function #' in native R. -#' @param rvar.transmit is a character string (in inverted commas) specifiying the +#' @param rvar.transmit is a character string (in inverted commas) specifying the #' name of the variable defining the rows in all of the 2 dimensional #' tables that form the output. Fully specified by argument in \code{ds.table}. #' For more information see help for \code{ds.table} -#' @param cvar.transmit is a character string specifiying the +#' @param cvar.transmit is a character string specifying the #' name of the variable defining the columns in all of the 2 dimensional #' tables that form the output. Fully specified by argument in \code{ds.table}. #' For more information see help for \code{ds.table} -#' @param stvar.transmit is a character string specifiying the +#' @param stvar.transmit is a character string specifying the #' name of the variable that indexes the separate two dimensional #' tables in the output if the call specifies a 3 dimensional table. #' Fully specified by argument in \code{ds.table}. diff --git a/R/tableDS.assign.R b/R/tableDS.assign.R index 6dceba21..f7a05909 100644 --- a/R/tableDS.assign.R +++ b/R/tableDS.assign.R @@ -8,15 +8,15 @@ #' as an object named by the argument of \code{ds.table}. For more #' information see help for \code{ds.table} in DataSHIELD and the \code{table} function #' in native R. -#' @param rvar.transmit is a character string (in inverted commas) specifiying the +#' @param rvar.transmit is a character string (in inverted commas) specifying the #' name of the variable defining the rows in all of the 2 dimensional #' tables that form the output. Fully specified by argument in \code{ds.table}. #' For more information see help for \code{ds.table} -#' @param cvar.transmit is a character string specifiying the +#' @param cvar.transmit is a character string specifying the #' name of the variable defining the columns in all of the 2 dimensional #' tables that form the output. Fully specified by argument in \code{ds.table}. #' For more information see help for \code{ds.table} -#' @param stvar.transmit is a character string specifiying the +#' @param stvar.transmit is a character string specifying the #' name of the variable that indexes the separate two dimensional #' tables in the output if the call specifies a 3 dimensional table. #' Fully specified by argument in \code{ds.table}. diff --git a/R/tableDS2.R b/R/tableDS2.R index e1ab252a..3ea4803b 100644 --- a/R/tableDS2.R +++ b/R/tableDS2.R @@ -13,15 +13,15 @@ #' is nevertheless TRUE, the name for the serverside table object defaults #' to 'newObj'. Fully specified by argument in \code{ds.table}. #' For more information see help for \code{ds.table} -#' @param rvar.transmit is a character string (in inverted commas) specifiying the +#' @param rvar.transmit is a character string (in inverted commas) specifying the #' name of the variable defining the rows in all of the 2 dimensional #' tables that form the output. Fully specified by argument in \code{ds.table}. #' For more information see help for \code{ds.table} -#' @param cvar.transmit is a character string specifiying the +#' @param cvar.transmit is a character string specifying the #' name of the variable defining the columns in all of the 2 dimensional #' tables that form the output. Fully specified by argument in \code{ds.table}. #' For more information see help for \code{ds.table} -#' @param stvar.transmit is a character string specifiying the +#' @param stvar.transmit is a character string specifying the #' name of the variable that indexes the separate two dimensional #' tables in the output if the call specifies a 3 dimensional table. #' Fully specified by argument in \code{ds.table}. diff --git a/R/vectorDS.R b/R/vectorDS.R index 8efacf97..e1bff36b 100644 --- a/R/vectorDS.R +++ b/R/vectorDS.R @@ -10,7 +10,7 @@ #' vectorDS <- function(...){ # Check Permissive Privacy Control Level. - dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana')) + dsBase::checkPermissivePrivacyControlLevel(c('permissive', 'banana', 'carrot')) # compute the vector's value out <- c(...) diff --git a/R/zzz.R b/R/zzz.R deleted file mode 100644 index 6586ae7c..00000000 --- a/R/zzz.R +++ /dev/null @@ -1,20 +0,0 @@ -ENV <- new.env() - -.onLoad = function(libname, pkgname) { - - #### !!! If making changes, update: .onLoad(), set_opts(), show_opts(), .check_options() - - options( - datashield.privacyLevel = 5, - default.datashield.privacyControlLevel = "banana", - default.nfilter.glm = 0.33, - default.nfilter.kNN = 3, - default.nfilter.string = 80, - default.nfilter.subset = 3, - default.nfilter.stringShort = 20, - default.nfilter.tab = 3, - default.nfilter.noise = 0.25, - default.nfilter.levels.density = 0.33, - default.nfilter.levels.max = 40 - ) -} \ No newline at end of file diff --git a/README.md b/README.md index aac29667..bf9c1ada 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,38 @@ -dsBase -====== +## dsBase: 'DataSHIELD' Server Side Base Functions -DataSHIELD server side base R library. +[![License](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html) +[![](https://www.r-pkg.org/badges/version/dsBase?color=black)](https://cran.r-project.org/package=dsBase) +[![R build +status](https://github.com/datashield/dsBase/workflows/R-CMD-check/badge.svg)](https://github.com/datashield/dsBase/actions) +[![Codecov test coverage](https://codecov.io/gh/datashield/dsBase/graph/badge.svg)](https://app.codecov.io/gh/datashield/dsBase) -[![License](https://img.shields.io/badge/license-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html) +## Installation -About -===== +You can install the released version of dsBase from +[CRAN](https://cran.r-project.org/package=dsBase) with: -DataSHIELD is a software package which allows you to do non-disclosive federated analysis on sensitive data. Our website (https://www.datashield.org) has in depth descriptions of what it is, how it works and how to install it. A key point to highlight is that DataSHIELD has a client-server infrastructure, so the dsBase package (https://github.com/datashield/dsBase) needs to be used in conjuction with the dsBaseClient package (https://github.com/datashield/dsBaseClient) - trying to use one without the other makes no sense. +``` r +install.packages("dsBase") +``` + +And the development version from +[GitHub](https://github.com/datashield/dsBase/) with: + + +``` r +install.packages("remotes") +remotes::install_github("datashield/dsBase", "") + +# Install v6.3.4 with the following +remotes::install_github("datashield/dsBase", "6.3.4") +``` + +For a full list of development branches, checkout https://github.com/datashield/dsBase/branches + + +## About + +DataSHIELD is a software package which allows you to do non-disclosive federated analysis on sensitive data. Our website (https://www.datashield.org) has in depth descriptions of what it is, how it works and how to install it. A key point to highlight is that DataSHIELD has a client-server infrastructure, so the dsBase package (https://github.com/datashield/dsBase) needs to be used in conjunction with the dsBaseClient package (https://github.com/datashield/dsBaseClient) - trying to use one without the other makes no sense. Detailed instructions on how to install DataSHIELD are at https://wiki.datashield.org/. The code here is organised as: @@ -18,3 +42,40 @@ Detailed instructions on how to install DataSHIELD are at https://wiki.datashiel | obiba CRAN | Where you probably should install DataSHIELD from. | | releases | Stable releases. | | master branch | Mostly in sync with the latest release, changes rarely. | + +## References + +[1] Burton P, Wilson R, Butters O, Ryser-Welch P, Westerberg A, Abarrategui L, Villegas-Diaz R, + Avraam D, Marcon Y, Bishop T, Gaye A, Escribà Montagut X, Wheater S (2025). _dsBase: 'DataSHIELD' Server Side Base Functions_. R + package version 6.3.4. . + +[2] Gaye A, Marcon Y, Isaeva J, LaFlamme P, Turner A, Jones E, Minion J, Boyd A, Newby C, Nuotio + M, Wilson R, Butters O, Murtagh B, Demir I, Doiron D, Giepmans L, Wallace S, Budin-Ljøsne I, + Oliver Schmidt C, Boffetta P, Boniol M, Bota M, Carter K, deKlerk N, Dibben C, Francis R, + Hiekkalinna T, Hveem K, Kvaløy K, Millar S, Perry I, Peters A, Phillips C, Popham F, Raab G, + Reischl E, Sheehan N, Waldenberger M, Perola M, van den Heuvel E, Macleod J, Knoppers B, + Stolk R, Fortier I, Harris J, Woffenbuttel B, Murtagh M, Ferretti V, Burton P (2014). + “DataSHIELD: taking the analysis to the data, not the data to the analysis.” _International + Journal of Epidemiology_, *43*(6), 1929-1944. . + +[3] Wilson R, W. Butters O, Avraam D, Baker J, Tedds J, Turner A, Murtagh M, R. Burton P (2017). + “DataSHIELD – New Directions and Dimensions.” _Data Science Journal_, *16*(21), 1-21. + . + +[4] Avraam D, Wilson R, Aguirre Chan N, Banerjee S, Bishop T, Butters O, Cadman T, Cederkvist L, + Duijts L, Escribà Montagut X, Garner H, Gonçalves G, González J, Haakma S, Hartlev M, + Hasenauer J, Huth M, Hyde E, Jaddoe V, Marcon Y, Mayrhofer M, Molnar-Gabor F, Morgan A, + Murtagh M, Nestor M, Nybo Andersen A, Parker S, Pinot de Moira A, Schwarz F, + Strandberg-Larsen K, Swertz M, Welten M, Wheater S, Burton P (2024). “DataSHIELD: + mitigating disclosure risk in a multi-site federated analysis platform.” _Bioinformatics + Advances_, *5*(1), 1-21. . + +> **_Note:_** Apple Mx architecture users, please be aware that there are some numerical limitations on this platform, which leads to unexpected results when using base R packages, like stats​. +> +> x <- c(0, 3, 7) +> +> 1 - cor(x, x)​ +> +> The above should result in a value of zero. +> +> _Also See:_ For more details see https://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f and the bug report: https://bugs.r-project.org/show_bug.cgi?id=18941 diff --git a/docs/404.html b/docs/404.html index c2a9f93c..828175ea 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1,5 +1,5 @@ - + @@ -32,7 +32,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -73,12 +73,12 @@

Page not found (404)

-

Site built with pkgdown 2.1.3.

+

Site built with pkgdown 2.2.0.

diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 158c5efe..5faa2d0e 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -1,5 +1,5 @@ -NA • dsBaseNA • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -256,11 +256,11 @@

NA

-

Site built with pkgdown 2.1.3.

+

Site built with pkgdown 2.2.0.

diff --git a/docs/authors.html b/docs/authors.html index cc06044e..a1aec549 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -1,5 +1,5 @@ -Authors and Citation • dsBaseAuthors and Citation • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -40,19 +40,19 @@

Authors and Citation

  • -

    Paul Burton. Author. +

    Paul Burton. Author.

  • -

    Rebecca Wilson. Author. +

    Rebecca Wilson. Author.

  • -

    Olly Butters. Author. +

    Olly Butters. Author.

  • -

    Patricia Ryser-Welch. Author. +

    Patricia Ryser-Welch. Author.

  • @@ -75,6 +75,18 @@

    Authors and Citation

    Yannick Marcon. Author.

  • +
  • +

    Tom Bishop. Author. +

    +
  • +
  • +

    Amadou Gaye. Author. +

    +
  • +
  • +

    Xavier Escribà-Montagut. Author. +

    +
  • Stuart Wheater. Author, maintainer.

    @@ -88,15 +100,61 @@

    Citation

    -

    Burton P, Wilson R, Butters O, Ryser-Welch P, Westerberg A, Abarrategui L, Villegas-Diaz R, Avraam D, Marcon Y, Wheater S (2025). -dsBase: DataSHIELD Server Site Base Functions. -R package version 6.3.3. +

    Burton P, Wilson R, Butters O, Ryser-Welch P, Westerberg A, Abarrategui L, Villegas-Diaz R, Avraam D, Marcon Y, Bishop T, Gaye A, Escribà-Montagut X, Wheater S (????). +dsBase: 'DataSHIELD' Server Side Base Functions. +R package version 6.3.5.9000.

    @Manual{,
    -  title = {dsBase: DataSHIELD Server Site Base Functions},
    -  author = {Paul Burton and Rebecca Wilson and Olly Butters and Patricia Ryser-Welch and Alex Westerberg and Leire Abarrategui and Roberto Villegas-Diaz and Demetris Avraam and Yannick Marcon and Stuart Wheater},
    -  year = {2025},
    -  note = {R package version 6.3.3},
    +  title = {dsBase: 'DataSHIELD' Server Side Base Functions},
    +  author = {Paul Burton and Rebecca Wilson and Olly Butters and Patricia Ryser-Welch and Alex Westerberg and Leire Abarrategui and Roberto Villegas-Diaz and Demetris Avraam and Yannick Marcon and Tom Bishop and Amadou Gaye and Xavier Escribà-Montagut and Stuart Wheater},
    +  note = {R package version 6.3.5.9000},
    +}
    +

    Gaye A, Marcon Y, Isaeva J, LaFlamme P, Turner A, Jones E, Minion J, Boyd A, Newby C, Nuotio M, Wilson R, Butters O, Murtagh B, Demir I, Doiron D, Giepmans L, Wallace S, Budin-Ljøsne I, Schmidt C, Boffetta P, Boniol M, Bota M, Carter K, deKlerk N, Dibben C, Francis R, Hiekkalinna T, Hveem K, Kvaløy K, Millar S, Perry I, Peters A, Phillips C, Popham F, Raab G, Reischl E, Sheehan N, Waldenberger M, Perola M, van den Heuvel E, Macleod J, Knoppers B, Stolk R, Fortier I, Harris J, Woffenbuttel B, Murtagh M, Ferretti V, Burton P (2014). +“DataSHIELD: taking the analysis to the data, not the data to the analysis.” +International Journal of Epidemiology, 43(6), 1929–1944. +doi:10.1093/ije/dyu188. +

    +
    @Article{,
    +  title = {{DataSHIELD: taking the analysis to the data, not the data to the analysis}},
    +  author = {Amadou Gaye and Yannick Marcon and Julia Isaeva and Philippe {LaFlamme} and Andrew Turner and Elinor M Jones and Joel Minion and Andrew W Boyd and Christopher J Newby and Marja-Liisa Nuotio and Rebecca Wilson and Oliver Butters and Barnaby Murtagh and Ipek Demir and Dany Doiron and Lisette Giepmans and Susan E Wallace and Isabelle Budin-Lj{\o}sne and Carsten O. Schmidt and Paolo Boffetta and Mathieu Boniol and Maria Bota and Kim W Carter and Nick {deKlerk} and Chris Dibben and Richard W Francis and Tero Hiekkalinna and Kristian Hveem and Kirsti Kval{\o}y and Sean Millar and Ivan J Perry and Annette Peters and Catherine M Phillips and Frank Popham and Gillian Raab and Eva Reischl and Nuala Sheehan and Melanie Waldenberger and Markus Perola and Edwin {{van den Heuvel}} and John Macleod and Bartha M Knoppers and Ronald P Stolk and Isabel Fortier and Jennifer R Harris and Bruce H R Woffenbuttel and Madeleine J Murtagh and Vincent Ferretti and Paul R Burton},
    +  journal = {International Journal of Epidemiology},
    +  year = {2014},
    +  volume = {43},
    +  number = {6},
    +  pages = {1929--1944},
    +  doi = {10.1093/ije/dyu188},
    +}
    +

    Wilson R, Butters O, Avraam D, Baker J, Tedds J, Turner A, Murtagh M, Burton P (2017). +“DataSHIELD – New Directions and Dimensions.” +Data Science Journal, 16(21), 1–21. +doi:10.5334/dsj-2017-021. +

    +
    @Article{,
    +  title = {{DataSHIELD – New Directions and Dimensions}},
    +  author = {Rebecca C. Wilson and Oliver W. Butters and Demetris Avraam and James Baker and Jonathan A. Tedds and Andrew Turner and Madeleine Murtagh and Paul R. Burton},
    +  journal = {Data Science Journal},
    +  year = {2017},
    +  volume = {16},
    +  number = {21},
    +  pages = {1--21},
    +  doi = {10.5334/dsj-2017-021},
    +}
    +

    Avraam D, Wilson R, Aguirre Chan N, Banerjee S, Bishop T, Butters O, Cadman T, Cederkvist L, Duijts L, Escribà Montagut X, Garner H, Gonçalves G, González J, Haakma S, Hartlev M, Hasenauer J, Huth M, Hyde E, Jaddoe V, Marcon Y, Mayrhofer M, Molnar-Gabor F, Morgan A, Murtagh M, Nestor M, Nybo Andersen A, Parker S, Pinot de Moira A, Schwarz F, Strandberg-Larsen K, Swertz M, Welten M, Wheater S, Burton P (2024). +“DataSHIELD: mitigating disclosure risk in a multi-site federated analysis platform.” +Bioinformatics Advances, 5(1), 1–21. +doi:10.1093/bioadv/vbaf046. +

    +
    @Article{,
    +  title = {{DataSHIELD: mitigating disclosure risk in a multi-site federated analysis platform}},
    +  author = {Demetris Avraam and Rebecca C Wilson and Noemi {{Aguirre Chan}} and Soumya Banerjee and Tom R P Bishop and Olly Butters and Tim Cadman and Luise Cederkvist and Liesbeth Duijts and Xavier {{Escrib{\a`a} Montagut}} and Hugh Garner and Gon{\c c}alo {Gon{\c c}alves} and Juan R Gonz{\a'a}lez and Sido Haakma and Mette Hartlev and Jan Hasenauer and Manuel Huth and Eleanor Hyde and Vincent W V Jaddoe and Yannick Marcon and Michaela Th Mayrhofer and Fruzsina Molnar-Gabor and Andrei Scott Morgan and Madeleine Murtagh and Marc Nestor and Anne-Marie {{Nybo Andersen}} and Simon Parker and Angela {{Pinot de Moira}} and Florian Schwarz and Katrine Strandberg-Larsen and Morris A Swertz and Marieke Welten and Stuart Wheater and Paul R Burton},
    +  journal = {Bioinformatics Advances},
    +  year = {2024},
    +  volume = {5},
    +  number = {1},
    +  pages = {1--21},
    +  doi = {10.1093/bioadv/vbaf046},
    +  editor = {Thomas Lengauer},
    +  publisher = {Oxford University Press (OUP)},
     }
    @@ -106,11 +164,11 @@

    Citation

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/index.html b/docs/index.html index 54bbe6e5..1f70741d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,18 +1,18 @@ - + -DataSHIELD Server Site Base Functions • dsBase +DataSHIELD Server Side Base Functions • dsBase - - + +

    +
    +install.packages("remotes")
    +remotes::install_github("datashield/dsBase", "<BRANCH>")
    +
    +# Install v6.3.4 with the following
    +remotes::install_github("datashield/dsBase", "6.3.4")
    +

    For a full list of development branches, checkout https://github.com/datashield/dsBase/branches

    + +
    +

    About +

    +

    DataSHIELD is a software package which allows you to do non-disclosive federated analysis on sensitive data. Our website (https://www.datashield.org) has in depth descriptions of what it is, how it works and how to install it. A key point to highlight is that DataSHIELD has a client-server infrastructure, so the dsBase package (https://github.com/datashield/dsBase) needs to be used in conjunction with the dsBaseClient package (https://github.com/datashield/dsBaseClient) - trying to use one without the other makes no sense.

    Detailed instructions on how to install DataSHIELD are at https://wiki.datashield.org/. The code here is organised as:

    @@ -91,12 +105,34 @@

    About

    +
    +
    +

    References +

    +

    [1] Burton P, Wilson R, Butters O, Ryser-Welch P, Westerberg A, Abarrategui L, Villegas-Diaz R, Avraam D, Marcon Y, Bishop T, Gaye A, Escribà Montagut X, Wheater S (2025). dsBase: ‘DataSHIELD’ Server Side Base Functions. R package version 6.3.4. https://doi.org/10.32614/CRAN.package.dsBase.

    +

    [2] Gaye A, Marcon Y, Isaeva J, LaFlamme P, Turner A, Jones E, Minion J, Boyd A, Newby C, Nuotio M, Wilson R, Butters O, Murtagh B, Demir I, Doiron D, Giepmans L, Wallace S, Budin-Ljøsne I, Oliver Schmidt C, Boffetta P, Boniol M, Bota M, Carter K, deKlerk N, Dibben C, Francis R, Hiekkalinna T, Hveem K, Kvaløy K, Millar S, Perry I, Peters A, Phillips C, Popham F, Raab G, Reischl E, Sheehan N, Waldenberger M, Perola M, van den Heuvel E, Macleod J, Knoppers B, Stolk R, Fortier I, Harris J, Woffenbuttel B, Murtagh M, Ferretti V, Burton P (2014). “DataSHIELD: taking the analysis to the data, not the data to the analysis.” International Journal of Epidemiology, 43(6), 1929-1944. https://doi.org/10.1093/ije/dyu188.

    +

    [3] Wilson R, W. Butters O, Avraam D, Baker J, Tedds J, Turner A, Murtagh M, R. Burton P (2017). “DataSHIELD – New Directions and Dimensions.” Data Science Journal, 16(21), 1-21. https://doi.org/10.5334/dsj-2017-021.

    +

    [4] Avraam D, Wilson R, Aguirre Chan N, Banerjee S, Bishop T, Butters O, Cadman T, Cederkvist L, Duijts L, Escribà Montagut X, Garner H, Gonçalves G, González J, Haakma S, Hartlev M, Hasenauer J, Huth M, Hyde E, Jaddoe V, Marcon Y, Mayrhofer M, Molnar-Gabor F, Morgan A, Murtagh M, Nestor M, Nybo Andersen A, Parker S, Pinot de Moira A, Schwarz F, Strandberg-Larsen K, Swertz M, Welten M, Wheater S, Burton P (2024). “DataSHIELD: mitigating disclosure risk in a multi-site federated analysis platform.” Bioinformatics Advances, 5(1), 1-21. https://doi.org/10.1093/bioadv/vbaf046.

    +
    +

    Note: Apple Mx architecture users, please be aware that there are some numerical limitations on this platform, which leads to unexpected results when using base R packages, like stats​.

    +

    x <- c(0, 3, 7)

    +

    1 - cor(x, x)​

    +

    The above should result in a value of zero.

    +

    Also See: For more details see https://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f and the bug report: https://bugs.r-project.org/show_bug.cgi?id=18941

    +
    @@ -81,11 +81,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/asDataMatrixDS.html b/docs/reference/asDataMatrixDS.html index f85ca4b5..2b8fb1d3 100644 --- a/docs/reference/asDataMatrixDS.html +++ b/docs/reference/asDataMatrixDS.html @@ -1,5 +1,5 @@ -asDataMatrixDS a serverside assign function called by ds.asDataMatrix — asDataMatrixDS • dsBaseasDataMatrixDS a serverside assign function called by ds.asDataMatrix — asDataMatrixDS • dsBaseDetermines the levels of the input variable in each single study — asFactorDS1 • dsBaseDetermines the levels of the input variable in each single study — asFactorDS1 • dsBaseConverts a numeric vector into a factor — asFactorDS2 • dsBaseConverts a numeric vector into a factor — asFactorDS2 • dsBaseConverts a numeric vector into a factor — asFactorSimpleDS • dsBaseConverts a numeric vector into a factor — asFactorSimpleDS • dsBaseCoerces an R object into class integer — asIntegerDS • dsBaseCoerces an R object into class integer — asIntegerDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -82,11 +82,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/asListDS.html b/docs/reference/asListDS.html index d61006a3..ab9910cc 100644 --- a/docs/reference/asListDS.html +++ b/docs/reference/asListDS.html @@ -1,5 +1,5 @@ -asListDS a serverside aggregate function called by ds.asList — asListDS • dsBaseasListDS a serverside aggregate function called by ds.asList — asListDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -95,11 +95,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/asLogicalDS.html b/docs/reference/asLogicalDS.html index f4c4bc98..689e2461 100644 --- a/docs/reference/asLogicalDS.html +++ b/docs/reference/asLogicalDS.html @@ -1,5 +1,5 @@ -Coerces an R object into class numeric — asLogicalDS • dsBaseCoerces an R object into class numeric — asLogicalDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -81,11 +81,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/asMatrixDS.html b/docs/reference/asMatrixDS.html index 0ea58de5..a85c0c7c 100644 --- a/docs/reference/asMatrixDS.html +++ b/docs/reference/asMatrixDS.html @@ -1,5 +1,5 @@ -Coerces an R object into a matrix — asMatrixDS • dsBaseCoerces an R object into a matrix — asMatrixDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -81,11 +81,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/asNumericDS.html b/docs/reference/asNumericDS.html index 7c2dc6f5..da79a362 100644 --- a/docs/reference/asNumericDS.html +++ b/docs/reference/asNumericDS.html @@ -1,5 +1,5 @@ -Coerces an R object into class numeric — asNumericDS • dsBaseCoerces an R object into class numeric — asNumericDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -82,11 +82,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/aucDS.html b/docs/reference/aucDS.html index 407744e8..4800d9d1 100644 --- a/docs/reference/aucDS.html +++ b/docs/reference/aucDS.html @@ -1,5 +1,5 @@ -aucDS an aggregate function called by ds.auc — aucDS • dsBaseaucDS an aggregate function called by ds.auc — aucDS • dsBaseSecure ranking of "V2BR" (vector to be ranked) across all sources — blackBoxDS • dsBaseSecure ranking of "V2BR" (vector to be ranked) across all sources — blackBoxDS • dsBaseSecure ranking of "V2BR" (vector to be ranked) across all sources — blackBoxRanksDS • dsBaseSecure ranking of "V2BR" (vector to be ranked) across all sources — blackBoxRanksDS • dsBaseCreate the identity stats and necessary data to draw a plot on the client — boxPlotGGDS • dsBaseCreate the identity stats and necessary data to draw a plot on the client — boxPlotGGDS • dsBaseArrange data frame to pass it to the boxplot function — boxPlotGG_data_TreatmentDS • dsBaseArrange data frame to pass it to the boxplot function — boxPlotGG_data_TreatmentDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -84,11 +84,11 @@

    Value

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/boxPlotGG_data_Treatment_numericDS.html b/docs/reference/boxPlotGG_data_Treatment_numericDS.html index 1a0b9f54..1aa7bd26 100644 --- a/docs/reference/boxPlotGG_data_Treatment_numericDS.html +++ b/docs/reference/boxPlotGG_data_Treatment_numericDS.html @@ -1,5 +1,5 @@ -Arrange vector to pass it to the boxplot function — boxPlotGG_data_Treatment_numericDS • dsBaseArrange vector to pass it to the boxplot function — boxPlotGG_data_Treatment_numericDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -70,11 +70,11 @@

    Value

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/bp_standardsDS.html b/docs/reference/bp_standardsDS.html index e382632e..b7e661c4 100644 --- a/docs/reference/bp_standardsDS.html +++ b/docs/reference/bp_standardsDS.html @@ -1,5 +1,5 @@ -Calculates Blood pressure z-scores — bp_standardsDS • dsBaseCalculates Blood pressure z-scores — bp_standardsDS • dsBaseConcatenates objects into a vector or list — cDS • dsBaseConcatenates objects into a vector or list — cDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -77,11 +77,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/cbindDS.html b/docs/reference/cbindDS.html index cb248b52..3bed8b0a 100644 --- a/docs/reference/cbindDS.html +++ b/docs/reference/cbindDS.html @@ -1,5 +1,5 @@ -cbindDS called by ds.cbind — cbindDS • dsBasecbindDS called by ds.cbind — cbindDS • dsBaseChanges a reference level of a factor — changeRefGroupDS • dsBaseChanges a reference level of a factor — changeRefGroupDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -90,11 +90,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/checkNegValueDS.html b/docs/reference/checkNegValueDS.html index 42c77b36..e9d00fca 100644 --- a/docs/reference/checkNegValueDS.html +++ b/docs/reference/checkNegValueDS.html @@ -1,5 +1,5 @@ -Checks if a numeric variable has negative values — checkNegValueDS • dsBaseChecks if a numeric variable has negative values — checkNegValueDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -61,7 +61,7 @@

    Value

    Details

    -

    if a user sets the parameter 'weights' on the client site function ds.glm this +

    if a user sets the parameter 'weights' on the client side function ds.glm this server side function is called to verify that the 'weights' vector does not have negative values because no negative are allowed in weights.

    @@ -78,11 +78,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/checkPermissivePrivacyControlLevel.html b/docs/reference/checkPermissivePrivacyControlLevel.html index 045de671..6c19c2b0 100644 --- a/docs/reference/checkPermissivePrivacyControlLevel.html +++ b/docs/reference/checkPermissivePrivacyControlLevel.html @@ -1,5 +1,5 @@ -checkPermissivePrivacyControlLevel — checkPermissivePrivacyControlLevel • dsBasecheckPermissivePrivacyControlLevel — checkPermissivePrivacyControlLevel • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -40,7 +40,7 @@

    checkPermissivePrivacyControlLevel

    -

    This serverside function check that the server is running in "permissive" privacy control level.

    +

    This server-side function check that the server is running in "permissive" privacy control level.

    @@ -55,6 +55,10 @@

    Arguments

    is a vector of strings which contains the privacy control level names which are permitted by the calling method.

    +
    +

    Value

    +

    No return value, called for side effects

    +

    Details

    Tests whether the R option "datashield.privacyControlLevel" is set to "permissive", if it isn't @@ -63,7 +67,7 @@

    Details

    Author

    -

    Wheater, Dr SM., DataSHIELD Team.

    +

    Wheater, Dr SM., DataSHIELD Development Team.

    @@ -74,11 +78,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/classDS.html b/docs/reference/classDS.html index cf176c4f..47976968 100644 --- a/docs/reference/classDS.html +++ b/docs/reference/classDS.html @@ -1,5 +1,5 @@ -Returns the class of an object — classDS • dsBaseReturns the class of an object — classDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -76,11 +76,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/colnamesDS.html b/docs/reference/colnamesDS.html index 2ec376c0..4282c514 100644 --- a/docs/reference/colnamesDS.html +++ b/docs/reference/colnamesDS.html @@ -1,5 +1,5 @@ -Returns the column names of a data frame or matrix — colnamesDS • dsBaseReturns the column names of a data frame or matrix — colnamesDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -76,11 +76,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/completeCasesDS.html b/docs/reference/completeCasesDS.html index dcb87d6e..d84a6ede 100644 --- a/docs/reference/completeCasesDS.html +++ b/docs/reference/completeCasesDS.html @@ -1,5 +1,5 @@ -completeCasesDS: an assign function called by ds.completeCases — completeCasesDS • dsBasecompleteCasesDS: an assign function called by ds.completeCases — completeCasesDS • dsBaseComputes the sum of each variable and the sum of products for each pair of variables — corDS • dsBaseComputes the sum of each variable and the sum of products for each pair of variables — corDS • dsBaseTests for correlation between paired samples — corTestDS • dsBaseTests for correlation between paired samples — corTestDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -96,11 +96,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/covDS.html b/docs/reference/covDS.html index ec3dfaff..b92bbd44 100644 --- a/docs/reference/covDS.html +++ b/docs/reference/covDS.html @@ -1,5 +1,5 @@ -Computes the sum of each variable and the sum of products for each pair of variables — covDS • dsBaseComputes the sum of each variable and the sum of products for each pair of variables — covDS • dsBasedataFrameDS called by ds.dataFrame — dataFrameDS • dsBasedataFrameDS called by ds.dataFrame — dataFrameDS • dsBasedataFrameFillDS — dataFrameFillDS • dsBasedataFrameFillDS — dataFrameFillDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -102,11 +102,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/dataFrameSortDS.html b/docs/reference/dataFrameSortDS.html index 82acebe8..d8e8cd13 100644 --- a/docs/reference/dataFrameSortDS.html +++ b/docs/reference/dataFrameSortDS.html @@ -1,5 +1,5 @@ -Sorting and reordering data frames, vectors or matrices — dataFrameSortDS • dsBaseSorting and reordering data frames, vectors or matrices — dataFrameSortDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -116,11 +116,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/dataFrameSubsetDS1.html b/docs/reference/dataFrameSubsetDS1.html index 53261426..98c1bb41 100644 --- a/docs/reference/dataFrameSubsetDS1.html +++ b/docs/reference/dataFrameSubsetDS1.html @@ -1,5 +1,5 @@ -dataFrameSubsetDS1 an aggregate function called by ds.dataFrameSubset — dataFrameSubsetDS1 • dsBasedataFrameSubsetDS1 an aggregate function called by ds.dataFrameSubset — dataFrameSubsetDS1 • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -142,11 +142,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/dataFrameSubsetDS2.html b/docs/reference/dataFrameSubsetDS2.html index f8473edc..91a1413e 100644 --- a/docs/reference/dataFrameSubsetDS2.html +++ b/docs/reference/dataFrameSubsetDS2.html @@ -1,5 +1,5 @@ -dataFrameSubsetDS2 an assign function called by ds.dataFrameSubset — dataFrameSubsetDS2 • dsBasedataFrameSubsetDS2 an assign function called by ds.dataFrameSubset — dataFrameSubsetDS2 • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -150,11 +150,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/densityGridDS.html b/docs/reference/densityGridDS.html index 8e044a8a..b84830f0 100644 --- a/docs/reference/densityGridDS.html +++ b/docs/reference/densityGridDS.html @@ -1,5 +1,5 @@ -Generates a density grid with or without a priori defined limits — densityGridDS • dsBaseGenerates a density grid with or without a priori defined limits — densityGridDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -40,7 +40,7 @@

    Generates a density grid with or without a priori defined limits

    -

    Generates a density grid that can then be used for heatmap or countour plots.

    +

    Generates a density grid that can then be used for heatmap or contour plots.

    @@ -116,11 +116,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/dimDS.html b/docs/reference/dimDS.html index 6f97be66..36ae7dbf 100644 --- a/docs/reference/dimDS.html +++ b/docs/reference/dimDS.html @@ -1,5 +1,5 @@ -Returns the dimension of a data frame or matrix — dimDS • dsBaseReturns the dimension of a data frame or matrix — dimDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -76,11 +76,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/dmtC2SDS.html b/docs/reference/dmtC2SDS.html index c739b203..e5bce26b 100644 --- a/docs/reference/dmtC2SDS.html +++ b/docs/reference/dmtC2SDS.html @@ -1,5 +1,5 @@ -Copy a clientside data.frame, matrix or tibble (DMT) to the serverside. — dmtC2SDS • dsBaseCopy a clientside data.frame, matrix or tibble (DMT) to the serverside. — dmtC2SDS • dsBasedsBase: 'DataSHIELD' Server Side Base Functions — dsBase-package • dsBase + + +
    +
    + + + +
    +
    + + +
    +

    Base 'DataSHIELD' functions for the server side. 'DataSHIELD' is a software package which allows you to do non-disclosive federated analysis on sensitive data. 'DataSHIELD' analytic functions have been designed to only share non disclosive summary statistics, with built in automated output checking based on statistical disclosure control. With data sites setting the threshold values for the automated output checks. For more details, see 'citation("dsBase")'.

    +
    + + +
    +

    Author

    +

    Maintainer: Stuart Wheater stuart.wheater@arjuna.com (ORCID)

    +

    Authors:

    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.2.0.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/elsplineDS.html b/docs/reference/elsplineDS.html index 822c68f8..699ad119 100644 --- a/docs/reference/elsplineDS.html +++ b/docs/reference/elsplineDS.html @@ -1,5 +1,5 @@ -Basis for a piecewise linear spline with meaningful coefficients — elsplineDS • dsBaseBasis for a piecewise linear spline with meaningful coefficients — elsplineDS • dsBaseSecure ranking of "V2BR" (vector to be ranked) across all sources and use of these ranks to estimate global quantiles across all studies — extractQuantilesDS1 • dsBaseSecure ranking of "V2BR" (vector to be ranked) across all sources and use of these ranks to estimate global quantiles across all studies — extractQuantilesDS1 • dsBaseSecure ranking of "V2BR" (vector to be ranked) across all sources and use of these ranks to estimate global quantiles across all studies — extractQuantilesDS2 • dsBaseSecure ranking of "V2BR" (vector to be ranked) across all sources and use of these ranks to estimate global quantiles across all studies — extractQuantilesDS2 • dsBasegamlssDS an aggregate function called by ds.galmss — gamlssDS • dsBase dsBase - 6.3.3 + 6.3.5.9000 @@ -40,7 +40,7 @@
    @@ -208,11 +208,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/getWGSRDS.html b/docs/reference/getWGSRDS.html index 1afd7798..7ed44dbb 100644 --- a/docs/reference/getWGSRDS.html +++ b/docs/reference/getWGSRDS.html @@ -1,5 +1,5 @@ -Computes the WHO Growth Reference z-scores of anthropometric data — getWGSRDS • dsBaseComputes the WHO Growth Reference z-scores of anthropometric data — getWGSRDS • dsBaseglmDS1 called by ds.glm — glmDS1 • dsBaseglmDS1 called by ds.glm — glmDS1 • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000
    @@ -40,7 +40,7 @@

    glmDS1 called by ds.glm

    -

    This is the first serverside aggregate function called by ds.glm

    +

    This is the first server-side aggregate function called by ds.glm

    @@ -75,6 +75,10 @@

    Arguments

    analysed under the specified model

    +
    +

    Value

    +

    List with values from GLM model.

    +

    Details

    It is an @@ -96,11 +100,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/glmDS2.html b/docs/reference/glmDS2.html index 2cefd28f..03731c72 100644 --- a/docs/reference/glmDS2.html +++ b/docs/reference/glmDS2.html @@ -1,5 +1,5 @@ -glmDS2 called by ds.glm — glmDS2 • dsBaseglmDS2 called by ds.glm — glmDS2 • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -40,7 +40,7 @@

    glmDS2 called by ds.glm

    -

    This is the second serverside aggregate function called by ds.glm.

    +

    This is the second server-side aggregate function called by ds.glm.

    @@ -79,6 +79,10 @@

    Arguments

    the data to be analysed under the specified model same

    +
    +

    Value

    +

    List with values from GLM model

    +

    Details

    It is an aggregate function that uses the model structure and starting @@ -102,11 +106,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/glmPredictDS.ag.html b/docs/reference/glmPredictDS.ag.html index a9187893..8d31da48 100644 --- a/docs/reference/glmPredictDS.ag.html +++ b/docs/reference/glmPredictDS.ag.html @@ -1,5 +1,5 @@ -predict regression responses from a glm object — glmPredictDS.ag • dsBasepredict regression responses from a glm object — glmPredictDS.ag • dsBasepredict regression responses from a glm object — glmPredictDS.as • dsBasepredict regression responses from a glm object — glmPredictDS.as • dsBaseFit a Generalized Linear Model (GLM) with pooling via Study Level Meta-Analysis (SLMA) — glmSLMADS.assign • dsBaseFit a Generalized Linear Model (GLM) with pooling via Study Level Meta-Analysis (SLMA) — glmSLMADS.assign • dsBaseFit a Generalized Linear Model (GLM) with pooling via Study Level Meta-Analysis (SLMA) — glmSLMADS1 • dsBaseFit a Generalized Linear Model (GLM) with pooling via Study Level Meta-Analysis (SLMA) — glmSLMADS1 • dsBaseFit a Generalized Linear Model (GLM) with pooling via Study Level Meta-Analysis (SLMA) — glmSLMADS2 • dsBaseFit a Generalized Linear Model (GLM) with pooling via Study Level Meta-Analysis (SLMA) — glmSLMADS2 • dsBasesummarize a glm object on the serverside — glmSummaryDS.ag • dsBasesummarize a glm object on the serverside — glmSummaryDS.ag • dsBasesummarize a glm object on the serverside — glmSummaryDS.as • dsBasesummarize a glm object on the serverside — glmSummaryDS.as • dsBaseFitting generalized linear mixed effect models - serverside function — glmerSLMADS.assign • dsBaseFitting generalized linear mixed effect models - serverside function — glmerSLMADS.assign • dsBaseFitting generalized linear mixed effect models - serverside function — glmerSLMADS2 • dsBaseFitting generalized linear mixed effect models - serverside function — glmerSLMADS2 • dsBaseCalculates the coordinates of the centroid of each n nearest neighbours — heatmapPlotDS • dsBaseCalculates the coordinates of the centroid of each n nearest neighbours — heatmapPlotDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -60,7 +60,7 @@

    Arguments

    k
    -

    the number of the nearest neghbours for which their centroid is calculated if the +

    the number of the nearest neighbours for which their centroid is calculated if the method.indicator is equal to 1 (i.e. deterministic method).

    @@ -103,11 +103,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/hetcorDS.html b/docs/reference/hetcorDS.html index e4d36f35..f080e55c 100644 --- a/docs/reference/hetcorDS.html +++ b/docs/reference/hetcorDS.html @@ -1,5 +1,5 @@ -Heterogeneous Correlation Matrix — hetcorDS • dsBaseHeterogeneous Correlation Matrix — hetcorDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -93,7 +93,7 @@

    Value

    Details

    -

    Computes a heterogenous correlation matrix, consisting of Pearson product-moment +

    Computes a heterogeneous correlation matrix, consisting of Pearson product-moment correlations between numeric variables, polyserial correlations between numeric and ordinal variables, and polychoric correlations between ordinal variables.

    @@ -110,11 +110,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/histogramDS1.html b/docs/reference/histogramDS1.html index 59888e26..3d90be9e 100644 --- a/docs/reference/histogramDS1.html +++ b/docs/reference/histogramDS1.html @@ -1,8 +1,8 @@ -returns the minimum and the maximum of the input numeric vector — histogramDS1 • dsBasereturns the minimum and the maximum of the input numeric vector — histogramDS1 • dsBaseComputes a histogram of the input variable without plotting. — histogramDS2 • dsBaseComputes a histogram of the input variable without plotting. — histogramDS2 • dsBase dsBase - 6.3.3 + 6.3.5.9000 @@ -83,7 +83,7 @@

    Arguments

    k
    -

    the number of the nearest neghbours for which their centroid is calculated if the +

    the number of the nearest neighbours for which their centroid is calculated if the method.indicator is equal to 2 (i.e. deterministic method).

    @@ -113,11 +113,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/igb_standardsDS.html b/docs/reference/igb_standardsDS.html index 57a18298..56a62b4a 100644 --- a/docs/reference/igb_standardsDS.html +++ b/docs/reference/igb_standardsDS.html @@ -1,5 +1,5 @@ -Converts birth measurements to intergrowth z-scores/centiles — igb_standardsDS • dsBaseConverts birth measurements to intergrowth z-scores/centiles — igb_standardsDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -114,11 +114,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/index.html b/docs/reference/index.html index e02e299b..ce6e0a97 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -1,5 +1,5 @@ -Package index • dsBasePackage index • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -208,7 +208,7 @@

    All functions

    gamlssDS()

    -

    gamlssDS an aggregate function called by ds.galmss

    +

    gamlssDS an aggregate function called by ds.gamlss

    getWGSRDS()

    @@ -369,10 +369,14 @@

    All functions matrixTransposeDS()

    matrixTransposeDS serverside assign function called by ds.matrixTranspose

    + +

    mdPatternDS()

    + +

    Missing data pattern with disclosure control

    meanDS()

    -

    Computes statistical mean of a vectores

    +

    Computes statistical mean of a vector

    meanSdGpDS()

    @@ -582,11 +586,11 @@

    All functions
    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/isNaDS.html b/docs/reference/isNaDS.html index 076c968b..60110a6c 100644 --- a/docs/reference/isNaDS.html +++ b/docs/reference/isNaDS.html @@ -1,5 +1,5 @@ -Checks if a vector is empty — isNaDS • dsBaseChecks if a vector is empty — isNaDS • dsBaseChecks if an input is valid — isValidDS • dsBaseChecks if an input is valid — isValidDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -76,11 +76,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/kurtosisDS1.html b/docs/reference/kurtosisDS1.html index 9d7f71f0..6c942ba4 100644 --- a/docs/reference/kurtosisDS1.html +++ b/docs/reference/kurtosisDS1.html @@ -1,5 +1,5 @@ -Calculates the kurtosis of a numeric variable — kurtosisDS1 • dsBaseCalculates the kurtosis of a numeric variable — kurtosisDS1 • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -83,11 +83,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/kurtosisDS2.html b/docs/reference/kurtosisDS2.html index 70eb233f..a3be6590 100644 --- a/docs/reference/kurtosisDS2.html +++ b/docs/reference/kurtosisDS2.html @@ -1,5 +1,5 @@ -Calculates the kurtosis of a numeric variable — kurtosisDS2 • dsBaseCalculates the kurtosis of a numeric variable — kurtosisDS2 • dsBaseReturns the length of a vector or list — lengthDS • dsBaseReturns the length of a vector or list — lengthDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -76,11 +76,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/levelsDS.html b/docs/reference/levelsDS.html index 7ccd6243..93bec9bb 100644 --- a/docs/reference/levelsDS.html +++ b/docs/reference/levelsDS.html @@ -1,5 +1,5 @@ -Returns the levels of a factor vector — levelsDS • dsBaseReturns the levels of a factor vector — levelsDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -76,11 +76,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/lexisDS1.html b/docs/reference/lexisDS1.html index 302480c5..d59e1378 100644 --- a/docs/reference/lexisDS1.html +++ b/docs/reference/lexisDS1.html @@ -1,5 +1,5 @@ -lexisDS1 — lexisDS1 • dsBaselexisDS1 — lexisDS1 • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -40,7 +40,7 @@

    lexisDS1

    -

    The first serverside function called by ds.lexis.

    +

    The first server-side function called by ds.lexis.

    @@ -55,6 +55,10 @@

    Arguments

    a character string specifying the variable holding the time that each individual is censored or fails

    +
    +

    Value

    +

    List with `max.time`

    +

    Details

    This is an aggregate function. @@ -73,11 +77,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/lexisDS2.html b/docs/reference/lexisDS2.html index 39b99d50..9e1e61a3 100644 --- a/docs/reference/lexisDS2.html +++ b/docs/reference/lexisDS2.html @@ -1,5 +1,5 @@ -lexisDS2 — lexisDS2 • dsBaselexisDS2 — lexisDS2 • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -78,7 +78,7 @@

    Arguments

    idCol

    a clientside generated character string specifying the variable -holding the IDs of indivuals in the data set to be expanded

    +holding the IDs of individuals in the data set to be expanded

    entryCol
    @@ -103,15 +103,19 @@

    Arguments

    'data' argument is set the full data.frame will be expanded and carried forward

    +
    +

    Value

    +

    List with `expanded.table`

    +

    Details

    This is the assign function which actually creates -the expanded dataframe containing surival data for a piecewise exponential +the expanded dataframe containing survival data for a piecewise exponential regression. lexisDS2 also carries out a series of disclosure checks and if the arguments or data fail any of those tests, -creation of the exapanded dataframe is blocked and an appropriate serverside error +creation of the expanded dataframe is blocked and an appropriate serverside error message is stored. For more details see the extensive header for ds.lexis.

    @@ -128,11 +132,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/lexisDS3.html b/docs/reference/lexisDS3.html index 023ff8e4..97182f3d 100644 --- a/docs/reference/lexisDS3.html +++ b/docs/reference/lexisDS3.html @@ -1,5 +1,5 @@ -@title lexisDS3 — lexisDS3 • dsBase@title lexisDS3 — lexisDS3 • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -47,6 +47,10 @@

    @title lexisDS3

    lexisDS3()
    +
    +

    Value

    +

    Data frame with `messageobj` object

    +

    Details

    This is an assign function that simplifies the @@ -63,11 +67,11 @@

    Details

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/listDS.html b/docs/reference/listDS.html index 459dc9f3..8e1f3729 100644 --- a/docs/reference/listDS.html +++ b/docs/reference/listDS.html @@ -1,5 +1,5 @@ -Coerce objects into a list — listDS • dsBaseCoerce objects into a list — listDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -81,11 +81,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/listDisclosureSettingsDS.html b/docs/reference/listDisclosureSettingsDS.html index 10134413..37e561ee 100644 --- a/docs/reference/listDisclosureSettingsDS.html +++ b/docs/reference/listDisclosureSettingsDS.html @@ -1,5 +1,5 @@ -listDisclosureSettingsDS — listDisclosureSettingsDS • dsBaselistDisclosureSettingsDS — listDisclosureSettingsDS • dsBaseFitting linear mixed effect models - serverside function — lmerSLMADS.assign • dsBaseFitting linear mixed effect models - serverside function — lmerSLMADS.assign • dsBaseFitting linear mixed effect models - serverside function — lmerSLMADS2 • dsBaseFitting linear mixed effect models - serverside function — lmerSLMADS2 • dsBaselists all objects on a serverside environment — lsDS • dsBaselists all objects on a serverside environment — lsDS • dsBaseBasis for a piecewise linear spline with meaningful coefficients — lsplineDS • dsBaseBasis for a piecewise linear spline with meaningful coefficients — lsplineDS • dsBasematrixDS assign function called by ds.matrix — matrixDS • dsBasematrixDS assign function called by ds.matrix — matrixDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -109,11 +109,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/matrixDetDS1.html b/docs/reference/matrixDetDS1.html index 9de0320b..1f6f482a 100644 --- a/docs/reference/matrixDetDS1.html +++ b/docs/reference/matrixDetDS1.html @@ -1,5 +1,5 @@ -matrixDetDS aggregate function called by ds.matrixDet.report — matrixDetDS1 • dsBasematrixDetDS aggregate function called by ds.matrixDet.report — matrixDetDS1 • dsBasematrixDetDS assign function called by ds.matrixDet — matrixDetDS2 • dsBasematrixDetDS assign function called by ds.matrixDet — matrixDetDS2 • dsBasematrixDiagDS assign function called by ds.matrixDiag — matrixDiagDS • dsBasematrixDiagDS assign function called by ds.matrixDiag — matrixDiagDS • dsBasematrixDimnamesDS assign function called by ds.matrixDimnames — matrixDimnamesDS • dsBasematrixDimnamesDS assign function called by ds.matrixDimnames — matrixDimnamesDS • dsBasematrixInvertDS serverside assign function called by ds.matrixInvert — matrixInvertDS • dsBasematrixInvertDS serverside assign function called by ds.matrixInvert — matrixInvertDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -79,11 +79,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/matrixMultDS.html b/docs/reference/matrixMultDS.html index 6af3ff82..4a473555 100644 --- a/docs/reference/matrixMultDS.html +++ b/docs/reference/matrixMultDS.html @@ -1,5 +1,5 @@ -matrixMultDS serverside assign function called by ds.matrixMult — matrixMultDS • dsBasematrixMultDS serverside assign function called by ds.matrixMult — matrixMultDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -69,7 +69,7 @@

    Value

    Details

    Undertakes standard matrix multiplication where with input matrices A and B with -dimensions A: mxn and B: nxp the output C has dimensions mxp and each elemnt C[i,j] has +dimensions A: mxn and B: nxp the output C has dimensions mxp and each element C[i,j] has value equal to the dot product of row i of A and column j of B where the dot product is obtained as sum(A[i,1]*B[1,j] + A[i,2]*B[2,j] + .... + A[i,n]*B[n,j]). This calculation is only valid if the number of columns of A is the same as the number of rows of B

    @@ -87,11 +87,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/matrixTransposeDS.html b/docs/reference/matrixTransposeDS.html index ea659893..2dc8d9a7 100644 --- a/docs/reference/matrixTransposeDS.html +++ b/docs/reference/matrixTransposeDS.html @@ -1,5 +1,5 @@ -matrixTransposeDS serverside assign function called by ds.matrixTranspose — matrixTransposeDS • dsBasematrixTransposeDS serverside assign function called by ds.matrixTranspose — matrixTransposeDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -80,11 +80,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/mdPatternDS.html b/docs/reference/mdPatternDS.html new file mode 100644 index 00000000..6ed7c777 --- /dev/null +++ b/docs/reference/mdPatternDS.html @@ -0,0 +1,127 @@ + +Missing data pattern with disclosure control — mdPatternDS • dsBase + + +
    +
    + + + +
    +
    + + +
    +

    This function is a serverside aggregate function that computes the +missing data pattern using mice::md.pattern and applies disclosure control to +prevent revealing small cell counts.

    +
    + +
    +
    mdPatternDS(x)
    +
    + +
    +

    Arguments

    + + +
    x
    +

    a character string specifying the name of a data frame or matrix +containing the data to analyze for missing patterns.

    + +
    +
    +

    Value

    +

    A list containing:

    +
    pattern
    +

    The missing data pattern matrix with disclosure control applied

    + +
    valid
    +

    Logical indicating if all patterns meet disclosure requirements

    + +
    message
    +

    A message describing the validity status

    + +
    +
    +

    Details

    +

    This function calls the mice::md.pattern function to generate a matrix +showing the missing data patterns in the input data. To ensure disclosure control, +any pattern counts that are below the threshold (nfilter.tab, default=3) are +suppressed.

    +

    Suppression Method:

    +

    When a pattern count is below threshold: +- Row name is changed to "suppressed(<N>)" where N is the threshold +- All pattern values in that row are set to NA +- Summary row is also set to NA (prevents back-calculation)

    +

    Output Matrix Structure:

    +

    - Rows represent different missing data patterns (plus a summary row at the bottom) +- Row names contain pattern counts (or "suppressed(<N>)" for invalid patterns) +- Columns show 1 if variable is observed, 0 if missing +- Last column shows total number of missing values per pattern +- Last row shows total number of missing values per variable

    +

    Note for Pooling:

    +

    When this function is called from ds.mdPattern with type='combine', suppressed +patterns are excluded from pooling to prevent disclosure through subtraction. +This means pooled counts may underestimate the true total when patterns are +suppressed in some studies.

    +
    +
    +

    Author

    +

    Xavier Escribà montagut for DataSHIELD Development Team

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.2.0.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/meanDS.html b/docs/reference/meanDS.html index 94b6d15b..7806e4e4 100644 --- a/docs/reference/meanDS.html +++ b/docs/reference/meanDS.html @@ -1,5 +1,5 @@ -Computes statistical mean of a vectores — meanDS • dsBaseComputes statistical mean of a vector — meanDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -34,7 +34,7 @@
    @@ -77,11 +77,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/meanSdGpDS.html b/docs/reference/meanSdGpDS.html index d60d33d7..da49bc49 100644 --- a/docs/reference/meanSdGpDS.html +++ b/docs/reference/meanSdGpDS.html @@ -1,5 +1,5 @@ -MeanSdGpDS — meanSdGpDS • dsBaseMeanSdGpDS — meanSdGpDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000
    @@ -40,7 +40,7 @@

    MeanSdGpDS

    -

    Serverside function called by ds.meanSdGp

    +

    Server-side function called by ds.meanSdGp

    @@ -52,15 +52,19 @@

    Arguments

    X
    -

    a clientside supplied character string identifying the variable for which +

    a client-side supplied character string identifying the variable for which means/SDs are to be calculated

    INDEX
    -

    a clientside supplied character string identifying the factor across +

    a client-side supplied character string identifying the factor across which means/SDs are to be calculated

    +
    +

    Value

    +

    List with results from the group statistics

    +

    Details

    Computes the mean and standard deviation across groups defined by one @@ -79,11 +83,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/mergeDS.html b/docs/reference/mergeDS.html index c4f43601..3687174e 100644 --- a/docs/reference/mergeDS.html +++ b/docs/reference/mergeDS.html @@ -1,5 +1,5 @@ -mergeDS (assign function) called by ds.merge — mergeDS • dsBasemergeDS (assign function) called by ds.merge — mergeDS • dsBasemessageDS — messageDS • dsBasemessageDS — messageDS • dsBaseReturns the metadata, if any, about the specified variable — metadataDS • dsBaseReturns the metadata, if any, about the specified variable — metadataDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -58,7 +58,7 @@

    Arguments

    Value

    a list containing the metadata. The elements of the list will depend -on the meatadata available.

    +on the metadata available.

    Details

    @@ -77,11 +77,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/miceDS.html b/docs/reference/miceDS.html index 16eb2d98..e8d36df9 100644 --- a/docs/reference/miceDS.html +++ b/docs/reference/miceDS.html @@ -1,5 +1,5 @@ -Aggregate function called by ds.mice — miceDS • dsBaseAggregate function called by ds.mice — miceDS • dsBase dsBase - 6.3.3 + 6.3.5.9000 @@ -158,11 +158,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/minMaxRandDS.html b/docs/reference/minMaxRandDS.html index ac358eef..573110da 100644 --- a/docs/reference/minMaxRandDS.html +++ b/docs/reference/minMaxRandDS.html @@ -1,5 +1,5 @@ -Secure ranking of "V2BR" (vector to be ranked) across all sources — minMaxRandDS • dsBaseSecure ranking of "V2BR" (vector to be ranked) across all sources — minMaxRandDS • dsBaseReturn the names of a list object — namesDS • dsBaseReturn the names of a list object — namesDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -87,11 +87,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/nsDS.html b/docs/reference/nsDS.html index 75b60615..7d74fa0b 100644 --- a/docs/reference/nsDS.html +++ b/docs/reference/nsDS.html @@ -1,5 +1,5 @@ -Generate a Basis Matrix for Natural Cubic Splines — nsDS • dsBaseGenerate a Basis Matrix for Natural Cubic Splines — nsDS • dsBaseCounts the number of missing values — numNaDS • dsBaseCounts the number of missing values — numNaDS • dsBaseBasis for a piecewise linear spline with meaningful coefficients — qlsplineDS • dsBaseBasis for a piecewise linear spline with meaningful coefficients — qlsplineDS • dsBaseGenerates quantiles and mean information without maximum and minimum — quantileMeanDS • dsBaseGenerates quantiles and mean information without maximum and minimum — quantileMeanDS • dsBaserBinomDS serverside assign function — rBinomDS • dsBaserBinomDS serverside assign function — rBinomDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -102,11 +102,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/rNormDS.html b/docs/reference/rNormDS.html index e9b46e79..8f07ac7f 100644 --- a/docs/reference/rNormDS.html +++ b/docs/reference/rNormDS.html @@ -1,5 +1,5 @@ -rNormDS serverside assign function — rNormDS • dsBaserNormDS serverside assign function — rNormDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -110,11 +110,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/rPoisDS.html b/docs/reference/rPoisDS.html index 52bfee17..5eae496f 100644 --- a/docs/reference/rPoisDS.html +++ b/docs/reference/rPoisDS.html @@ -1,5 +1,5 @@ -rPoisDS serverside assign function — rPoisDS • dsBaserPoisDS serverside assign function — rPoisDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -95,11 +95,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/rUnifDS.html b/docs/reference/rUnifDS.html index 4e300ba8..5fdd2c11 100644 --- a/docs/reference/rUnifDS.html +++ b/docs/reference/rUnifDS.html @@ -1,5 +1,5 @@ -rUnifDS serverside assign function — rUnifDS • dsBaserUnifDS serverside assign function — rUnifDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -110,11 +110,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/rangeDS.html b/docs/reference/rangeDS.html index b02efc5a..e05a1a91 100644 --- a/docs/reference/rangeDS.html +++ b/docs/reference/rangeDS.html @@ -1,5 +1,5 @@ -returns the minimum and maximum of a numeric vector — rangeDS • dsBasereturns the minimum and maximum of a numeric vector — rangeDS • dsBaseSecure ranking of "V2BR" (vector to be ranked) across all sources — ranksSecureDS1 • dsBaseSecure ranking of "V2BR" (vector to be ranked) across all sources — ranksSecureDS1 • dsBaseSecure ranking of "V2BR" (vector to be ranked) across all sources — ranksSecureDS2 • dsBaseSecure ranking of "V2BR" (vector to be ranked) across all sources — ranksSecureDS2 • dsBase dsBase - 6.3.3 + 6.3.5.9000 @@ -99,11 +99,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/ranksSecureDS3.html b/docs/reference/ranksSecureDS3.html index fdfb81c1..3d5df277 100644 --- a/docs/reference/ranksSecureDS3.html +++ b/docs/reference/ranksSecureDS3.html @@ -1,5 +1,5 @@ -Secure ranking of "V2BR" (vector to be ranked) across all sources — ranksSecureDS3 • dsBaseSecure ranking of "V2BR" (vector to be ranked) across all sources — ranksSecureDS3 • dsBaseSecure ranking of "V2BR" (vector to be ranked) across all sources — ranksSecureDS4 • dsBaseSecure ranking of "V2BR" (vector to be ranked) across all sources — ranksSecureDS5 • dsBaseSecure ranking of "V2BR" (vector to be ranked) across all sources — ranksSecureDS5 • dsBaserbindDS called by ds.rbind — rbindDS • dsBaserbindDS called by ds.rbind — rbindDS • dsBasereShapeDS (assign function) called by ds.reShape — reShapeDS • dsBasereShapeDS (assign function) called by ds.reShape — reShapeDS • dsBaseRecodes the levels of a categorical variables — recodeLevelsDS • dsBaseRecodes the levels of a categorical variables — recodeLevelsDS • dsBaserecodeValuesDS an assign function called by ds.recodeValues — recodeValuesDS • dsBaserecodeValuesDS an assign function called by ds.recodeValues — recodeValuesDS • dsBaserepDS called by ds.rep — repDS • dsBaserepDS called by ds.rep — repDS • dsBase dsBase - 6.3.3 + 6.3.5.9000 @@ -87,7 +87,7 @@

    Arguments

    length.out.transmit

    This argument fixes the length of -the output repetive sequence vector +the output repetitive sequence vector For behaviour see help for ds.rep and "details from native R help for <rep>" (see above). This parameter is usually fully defined by the argument <length.out> in the call to ds.rep that itself calls repDS.

    @@ -192,11 +192,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/replaceNaDS.html b/docs/reference/replaceNaDS.html index 0cd5405e..60d2bb00 100644 --- a/docs/reference/replaceNaDS.html +++ b/docs/reference/replaceNaDS.html @@ -1,5 +1,5 @@ -Replaces the missing values in a vector — replaceNaDS • dsBaseReplaces the missing values in a vector — replaceNaDS • dsBasermDS an aggregate function called by ds.rm — rmDS • dsBasermDS an aggregate function called by ds.rm — rmDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -53,7 +53,7 @@

    Arguments

    x.names.transmit,

    the names of the objects to be deleted converted -into transmissable form, a comma seperated list of character string. The +into transmissible form, a comma separated list of character string. The argument is specified via the <x.names> argument of ds.rm

    @@ -90,11 +90,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/rowColCalcDS.html b/docs/reference/rowColCalcDS.html index 834f3d06..d5acc41a 100644 --- a/docs/reference/rowColCalcDS.html +++ b/docs/reference/rowColCalcDS.html @@ -1,5 +1,5 @@ -Computes sums and means of rows or columns of numeric arrays — rowColCalcDS • dsBaseComputes sums and means of rows or columns of numeric arrays — rowColCalcDS • dsBaserandom sampling and permuting of vectors, dataframes and matrices — sampleDS • dsBaserandom sampling and permuting of vectors, dataframes and matrices — sampleDS • dsBaseCalculates the coordinates of the data to be plot — scatterPlotDS • dsBaseCalculates the coordinates of the data to be plot — scatterPlotDS • dsBaseseqDS a serverside assign function called by ds.seq — seqDS • dsBaseseqDS a serverside assign function called by ds.seq — seqDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -135,11 +135,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/setSeedDS.html b/docs/reference/setSeedDS.html index f80e4677..3f93d5d5 100644 --- a/docs/reference/setSeedDS.html +++ b/docs/reference/setSeedDS.html @@ -1,5 +1,5 @@ -setSeedDs called by ds.setSeed, ds.rNorm, ds.rUnif, ds.rPois and ds.rBinom — setSeedDS • dsBasesetSeedDs called by ds.setSeed, ds.rNorm, ds.rUnif, ds.rPois and ds.rBinom — setSeedDS • dsBaseCalculates the skewness of a numeric variable — skewnessDS1 • dsBaseCalculates the skewness of a numeric variable — skewnessDS1 • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -83,11 +83,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/skewnessDS2.html b/docs/reference/skewnessDS2.html index f4e4064f..96ca37f2 100644 --- a/docs/reference/skewnessDS2.html +++ b/docs/reference/skewnessDS2.html @@ -1,5 +1,5 @@ -Calculates the skewness of a numeric variable — skewnessDS2 • dsBaseCalculates the skewness of a numeric variable — skewnessDS2 • dsBaseComputes the square root values of the input variable — sqrtDS • dsBaseComputes the square root values of the input variable — sqrtDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -80,11 +80,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/subsetByClassDS.html b/docs/reference/subsetByClassDS.html index b5bc54ea..fc546a46 100644 --- a/docs/reference/subsetByClassDS.html +++ b/docs/reference/subsetByClassDS.html @@ -1,5 +1,5 @@ -Breaks down a dataframe or a factor into its sub-classes — subsetByClassDS • dsBaseBreaks down a dataframe or a factor into its sub-classes — subsetByClassDS • dsBaseGenerates a valid subset of a table or a vector — subsetDS • dsBaseGenerates a valid subset of a table or a vector — subsetDS • dsBase @@ -19,7 +19,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -43,8 +43,8 @@

    Generates a valid subset of a table or a vector

    The function uses the R classical subsetting with squared brackets '[]' and allows also to -subset using a logical oprator and a threshold. The object to subset from must be a vector (factor, numeric -or charcater) or a table (data.frame or matrix).

    +subset using a logical operator and a threshold. The object to subset from must be a vector (factor, numeric +or character) or a table (data.frame or matrix).

    @@ -92,18 +92,18 @@

    Arguments

    varname

    a character, if the input data is a table, if this parameter is provided along with the 'logical' and 'threshold' -parameters, a subtable is based the threshold applied to the speicified variable. This parameter is however ignored if the parameter +parameters, a subtable is based the threshold applied to the specified variable. This parameter is however ignored if the parameter 'rows' and/or 'cols' are provided.

    Value

    -

    a subset of the vector, matric or dataframe as specified is stored on the server side

    +

    a subset of the vector, matrix or dataframe as specified is stored on the server side

    Details

    If the input data is a table: The user specifies the rows and/or columns to include in the subset if the input -object is a table; the columns can be refered to by their names. The name of a vector (i.e. a variable) can also be provided +object is a table; the columns can be referred to by their names. The name of a vector (i.e. a variable) can also be provided with a logical operator and a threshold (see example 3). If the input data is a vector: when the parameters 'rows', 'logical' and 'threshold' are all provided the last two are ignored ( 'rows' has precedence over the other two parameters then). @@ -124,11 +124,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/table1DDS.html b/docs/reference/table1DDS.html index 6796312e..574f90e4 100644 --- a/docs/reference/table1DDS.html +++ b/docs/reference/table1DDS.html @@ -1,5 +1,5 @@ -Creates 1-dimensional contingency tables — table1DDS • dsBaseCreates 1-dimensional contingency tables — table1DDS • dsBasetable2DDS (aggregate function) called by ds.table2D — table2DDS • dsBasetable2DDS (aggregate function) called by ds.table2D — table2DDS • dsBasetableDS.assign is the serverside assign function called by ds.table — tableDS.assign • dsBasetableDS.assign is the serverside assign function called by ds.table — tableDS.assign • dsBasetableDS is the first of two serverside aggregate functions called by ds.table — tableDS • dsBasetableDS is the first of two serverside aggregate functions called by ds.table — tableDS • dsBasetableDS is the second of two serverside aggregate functions called by ds.table — tableDS2 • dsBasetableDS is the second of two serverside aggregate functions called by ds.table — tableDS2 • dsBasetapplyDS.assign called by ds.tapply.assign — tapplyDS.assign • dsBasetapplyDS.assign called by ds.tapply.assign — tapplyDS.assign • dsBasetapplyDS called by ds.tapply — tapplyDS • dsBasetapplyDS called by ds.tapply — tapplyDS • dsBasetestObjExistsDS — testObjExistsDS • dsBasetestObjExistsDS — testObjExistsDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -40,7 +40,7 @@

    testObjExistsDS

    -

    The serverside function called by ds.testObjExists

    +

    The server-side function called by ds.testObjExists

    @@ -52,10 +52,14 @@

    Arguments

    test.obj.name
    -

    a clientside provided character string specifying the variable +

    a client-side provided character string specifying the variable whose presence is to be tested in each data source

    +
    +

    Value

    +

    List with `test.obj.exists` and `test.obj.class`

    +

    Details

    Tests whether a given object exists in @@ -76,11 +80,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/unListDS.html b/docs/reference/unListDS.html index d4209b51..c59d955e 100644 --- a/docs/reference/unListDS.html +++ b/docs/reference/unListDS.html @@ -1,5 +1,5 @@ -unListDS a serverside assign function called by ds.unList — unListDS • dsBaseunListDS a serverside assign function called by ds.unList — unListDS • dsBaseApplies the unique method to a server-side variable. — uniqueDS • dsBaseApplies the unique method to a server-side variable. — uniqueDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -77,11 +77,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/varDS.html b/docs/reference/varDS.html index a71334fe..f4a05a39 100644 --- a/docs/reference/varDS.html +++ b/docs/reference/varDS.html @@ -1,5 +1,5 @@ -Computes the variance of vector — varDS • dsBaseComputes the variance of vector — varDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -80,11 +80,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/reference/vectorDS.html b/docs/reference/vectorDS.html index 0597230b..36faaa54 100644 --- a/docs/reference/vectorDS.html +++ b/docs/reference/vectorDS.html @@ -1,5 +1,5 @@ -Creates a vector on the server-side. — vectorDS • dsBaseCreates a vector on the server-side. — vectorDS • dsBase @@ -17,7 +17,7 @@ dsBase - 6.3.3 + 6.3.5.9000 @@ -77,11 +77,11 @@

    Author

    -

    Site built with pkgdown 2.1.3.

    +

    Site built with pkgdown 2.2.0.

    diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 265de84e..0d5e1008 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -41,6 +41,7 @@ /reference/densityGridDS.html /reference/dimDS.html /reference/dmtC2SDS.html +/reference/dsBase-package.html /reference/elsplineDS.html /reference/extract.html /reference/extractQuantilesDS1.html @@ -88,6 +89,7 @@ /reference/matrixInvertDS.html /reference/matrixMultDS.html /reference/matrixTransposeDS.html +/reference/mdPatternDS.html /reference/meanDS.html /reference/meanSdGpDS.html /reference/mergeDS.html diff --git a/inst/CITATION b/inst/CITATION new file mode 100644 index 00000000..cf856ce6 --- /dev/null +++ b/inst/CITATION @@ -0,0 +1,134 @@ +bibentry("Manual", + other = unlist(citation(auto = meta), recursive = FALSE)) + +bibentry( + bibtype = "Article", + title = "{DataSHIELD: taking the analysis to the data, not the data to the analysis}", + author = c( + person("Amadou", "Gaye"), + person("Yannick", "Marcon"), + person("Julia", "Isaeva"), + person("Philippe", "{LaFlamme}"), + person("Andrew", "Turner"), + person("Elinor M", "Jones"), + person("Joel", "Minion"), + person("Andrew W", "Boyd"), + person("Christopher J", "Newby"), + person("Marja-Liisa", "Nuotio"), + person("Rebecca", "Wilson"), + person("Oliver", "Butters"), + person("Barnaby", "Murtagh"), + person("Ipek", "Demir"), + person("Dany", "Doiron"), + person("Lisette", "Giepmans"), + person("Susan E", "Wallace"), + person("Isabelle", "Budin-Lj{\\o}sne"), + person("Carsten O.", "Schmidt"), + person("Paolo", "Boffetta"), + person("Mathieu", "Boniol"), + person("Maria", "Bota"), + person("Kim W", "Carter"), + person("Nick", "{deKlerk}"), + person("Chris", "Dibben"), + person("Richard W", "Francis"), + person("Tero", "Hiekkalinna"), + person("Kristian", "Hveem"), + person("Kirsti", "Kval{\\o}y"), + person("Sean", "Millar"), + person("Ivan J", "Perry"), + person("Annette", "Peters"), + person("Catherine M", "Phillips"), + person("Frank", "Popham"), + person("Gillian", "Raab"), + person("Eva", "Reischl"), + person("Nuala", "Sheehan"), + person("Melanie", "Waldenberger"), + person("Markus", "Perola"), + person("Edwin", "{van den Heuvel}"), + person("John", "Macleod"), + person("Bartha M", "Knoppers"), + person("Ronald P", "Stolk"), + person("Isabel", "Fortier"), + person("Jennifer R", "Harris"), + person("Bruce H R", "Woffenbuttel"), + person("Madeleine J", "Murtagh"), + person("Vincent", "Ferretti"), + person("Paul R", "Burton") + ), + journal = "International Journal of Epidemiology", + year = "2014", + volume = "43", + number = "6", + pages = "1929--1944", + doi = "10.1093/ije/dyu188", +) + +bibentry( + bibtype = "Article", + title = "{DataSHIELD – New Directions and Dimensions}", + author = c( + person("Rebecca C.", "Wilson"), + person("Oliver W.", "Butters"), + person("Demetris", "Avraam"), + person("James", "Baker"), + person("Jonathan A.", "Tedds"), + person("Andrew", "Turner"), + person("Madeleine", "Murtagh"), + person("Paul R.", "Burton") + ), + journal = "Data Science Journal", + year = "2017", + volume = "16", + number = "21", + pages = "1--21", + doi = "10.5334/dsj-2017-021" +) + +bibentry( + bibtype = "Article", + title = "{DataSHIELD: mitigating disclosure risk in a multi-site federated analysis platform}", + author = c( + person("Demetris", "Avraam"), + person("Rebecca C", "Wilson"), + person("Noemi", "{Aguirre Chan}"), + person("Soumya", "Banerjee"), + person("Tom R P", "Bishop"), + person("Olly", "Butters"), + person("Tim", "Cadman"), + person("Luise", "Cederkvist"), + person("Liesbeth", "Duijts"), + person("Xavier", "{Escrib{\\a`a} Montagut}"), + person("Hugh", "Garner"), + person("Gon{\\c c}alo", "Gon{\\c c}alves"), + person("Juan R", "Gonz{\\a'a}lez"), + person("Sido", "Haakma"), + person("Mette", "Hartlev"), + person("Jan", "Hasenauer"), + person("Manuel", "Huth"), + person("Eleanor", "Hyde"), + person("Vincent W V", "Jaddoe"), + person("Yannick", "Marcon"), + person("Michaela Th", "Mayrhofer"), + person("Fruzsina", "Molnar-Gabor"), + person("Andrei Scott", "Morgan"), + person("Madeleine", "Murtagh"), + person("Marc", "Nestor"), + person("Anne-Marie", "{Nybo Andersen}"), + person("Simon", "Parker"), + person("Angela", "{Pinot de Moira}"), + person("Florian", "Schwarz"), + person("Katrine", "Strandberg-Larsen"), + person("Morris A", "Swertz"), + person("Marieke", "Welten"), + person("Stuart", "Wheater"), + person("Paul R", "Burton") + ), + journal = "Bioinformatics Advances", + year = "2024", + volume = "5", + number = "1", + pages = "1--21", + doi = "10.1093/bioadv/vbaf046", + editor = person("Thomas", "Lengauer"), + publisher = "Oxford University Press (OUP)" +) diff --git a/inst/DATASHIELD b/inst/DATASHIELD index cacfc42b..0c59f0c2 100644 --- a/inst/DATASHIELD +++ b/inst/DATASHIELD @@ -37,6 +37,7 @@ AggregateMethods: lmerSLMADS2, lsDS, matrixDetDS1, + mdPatternDS, meanDS, meanSdGpDS, messageDS, @@ -160,4 +161,16 @@ AssignMethods: acos=base::acos, atan=base::atan, sum=base::sum, - unlist=base::unlist \ No newline at end of file + unlist=base::unlist +Options: + datashield.privacyLevel=5, + default.datashield.privacyControlLevel="banana", + default.nfilter.glm=0.33, + default.nfilter.kNN=3, + default.nfilter.string=80, + default.nfilter.subset=3, + default.nfilter.stringShort=20, + default.nfilter.tab=3, + default.nfilter.noise=0.25, + default.nfilter.levels.density=0.33, + default.nfilter.levels.max=40 diff --git a/inst/WORDLIST b/inst/WORDLIST new file mode 100644 index 00000000..23ca495f --- /dev/null +++ b/inst/WORDLIST @@ -0,0 +1,327 @@ +Aguirre +BMI +Banerjee +Boniol +BooleDS +Bota +Budin +CG +Cederkvist +Codecov +DDS +DF +DMT +DMTs +DataSHIELD +Demir +Dibben +Doiron +Duijts +Escribà +Ferretti +Fortier +GAMLSS +Giepmans +GlobalEnv +González +Gonçalves +HC +Haakma +Hartlev +Hasenauer +Heuvel +Hiekkalinna +Huth +Hveem +Inf +Isaeva +Jaddoe +Knoppers +Kvaløy +LaFlamme +Ljøsne +MUAC +Macleod +Mayrhofer +MeanSdGpDS +Millar +Molnar +Montagut +Murtagh +Nuotio +Nybo +Perola +Poisson +Polychoric +Polyserial +R's +RS +Reischl +Ryser +SDS +SDs +SLMA +SSF +Schwarz +Serverside +Severside +Stasinopoulos +Stolk +Strandberg +Swertz +TBL +TDemetris +TSF +Tedds +WGS +Waldenberger +Welten +Woffenbuttel +Zbp +ag +asDataMatrix +asDataMatrixDS +asFactor +asFactorSimple +asList +asListDS +ascharacter +asdatamatrix +asinteger +auc +aucDS +bfa +blackBox +blackBoxDS +blackBoxRanksDS +blackbox +booleans +bp +byrow +casewise +cbind +cbindDS +cbinded +cbinding +centile +centiles +checkPermissivePrivacyControlLevel +childsds +clientside +colMeans +colSums +completeCases +completeCasesDS +crit +cs +cvar +cyc +dataFrame +dataFrameDS +dataFrameFill +dataFrameFillDS +dataFrameShort +dataFrameSort +dataFrameSortDS +dataFrameSubset +dataFrameSubsetDS +dataName +dataframesort +datashield +datasource +datasources +deKlerk +defaultMethod +df +dfdata +diag +disclosive +dmtC +ds +dsBaseClient +dups +eg +elspline +etc +extractQuantileDS +extractQuantiles +extractQuantilesDS +fixef +gamlss +gamlssDS +gd +ggplot +glm +glmDS +glmPredict +glmSLMA +glmSLMADS +glmSummary +glmSummaryDS +glme +glmer +glmerMod +glmerSLMA +glmerSLMADS +glmes +glmname +hca +hcircm +hetcor +hfa +idvar +igb +imputationSet +incomparables +inout +kendall +lencm +lexisDS +lfa +listDisclosureSettings +listDisclosureSettingsDS +lme +lmer +lmerMod +lmerSLMA +lmerSLMADS +lmerSLMDS +lmes +loess +lspline +manag +matdftbl +matrixDS +matrixDet +matrixDetDS +matrixDiag +matrixDiagDS +matrixDimnames +matrixDimnamesDS +matrixInvert +matrixInvertDS +matrixMult +matrixMultDS +matrixTranspose +matrixTransposeDS +maxit +mdata +meanSdGp +mergeDS +messageDS +messageobj +metafor +mfa +mids +misspecifications +modeling +mxn +mxp +nAGQ +namesDS +ncol +ncols +nearPD +newObj +newObject +newdataname +newobj +nfilter +nrows +num +nxp +obiba +obj +obs +param +pb +pearson +perc +poisson +polychoric +polyserial +predictorMatrix +privacyControlLevel +prob +probs +pseudodata +qlspline +quatric +rBinom +rBinomDS +rNorm +rNormDS +rPois +rPoisDS +rUnif +rUnifDS +ra +ranksSecure +ranksSecureDS +rbindDS +rbinded +rbinom +rd +reShape +reShapeDS +recodeValues +recodeValuesDS +repDS +rm +rmDS +rnorm +rowMeans +rowSums +rpois +runif +rvar +sR +samp +sampleDS +sbp +sd +sds +seedtext +sep +seq +seqDS +serverside +serversideMessage +setSeed +setSeedDS +setSeedDs +smallCellsRule +spearman +ssa +studyid +studysideMessage +studysideMessages +stvar +subtable +tableDS +tapply +tapplyDS +testObjExists +testObjExistsDS +th +tibble +timevar +tol +tsa +unList +uniques +unlist +useNA +val +vals +var +vect +wfa +wfh +wfl +wlr +wtkg +xvect +yvect +zscore +zscores diff --git a/man/asDataMatrixDS.Rd b/man/asDataMatrixDS.Rd index 1a87b0d2..3170e9af 100644 --- a/man/asDataMatrixDS.Rd +++ b/man/asDataMatrixDS.Rd @@ -24,7 +24,7 @@ class for all columns in data.frames. \details{ This assign function is based on the native R function \code{data.matrix} If applied to a data.frame, the native R function \code{as.matrix} -coverts all columns into character class. In contrast, if applied to +converts all columns into character class. In contrast, if applied to a data.frame the native R function \code{data.matrix} converts the data.frame to a matrix but maintains all data columns in their original class diff --git a/man/checkNegValueDS.Rd b/man/checkNegValueDS.Rd index e06e28ef..a811eaaf 100644 --- a/man/checkNegValueDS.Rd +++ b/man/checkNegValueDS.Rd @@ -16,7 +16,7 @@ a boolean; TRUE if the vector has one or more negative values and FALSE otherwis this function is only called by the client function \code{ds.glm}. } \details{ -if a user sets the parameter 'weights' on the client site function \code{ds.glm} this +if a user sets the parameter 'weights' on the client side function \code{ds.glm} this server side function is called to verify that the 'weights' vector does not have negative values because no negative are allowed in weights. } diff --git a/man/densityGridDS.Rd b/man/densityGridDS.Rd index ea18a3b0..2b254acf 100644 --- a/man/densityGridDS.Rd +++ b/man/densityGridDS.Rd @@ -38,7 +38,7 @@ If \code{limits} is set to "TRUE", limits defined by x.min, x.max, y.min and y.m a grid density matrix } \description{ -Generates a density grid that can then be used for heatmap or countour plots. +Generates a density grid that can then be used for heatmap or contour plots. } \details{ Invalid cells (cells with count < to the set filter value for the minimum allowed diff --git a/man/dmtC2SDS.Rd b/man/dmtC2SDS.Rd index 102d3859..524f82f0 100644 --- a/man/dmtC2SDS.Rd +++ b/man/dmtC2SDS.Rd @@ -40,11 +40,11 @@ the clientside DMT to be transferred.} Fixed by the clientside function as equal to the number of columns in the clientside DMT to be transferred.} -\item{colnames.transmit}{a parser-transmissable vector specifying the name of each column +\item{colnames.transmit}{a parser-transmissible vector specifying the name of each column in the DMT being transferred from clientside to serverside. Generated automatically by clientside function from colnames of clientside DMT.} -\item{colclass.transmit}{a parser-transmissable vector specifying the class of the +\item{colclass.transmit}{a parser-transmissible vector specifying the class of the vector representing each individual column in the DMT to be transferred. Generated automatically by clientside function. This allows the transmission of DMTs containing columns with different classes.If something is going to go wrong with diff --git a/man/dsBase-package.Rd b/man/dsBase-package.Rd new file mode 100644 index 00000000..725c4131 --- /dev/null +++ b/man/dsBase-package.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/dsBase-package.R +\docType{package} +\name{dsBase-package} +\alias{dsBase} +\alias{dsBase-package} +\title{dsBase: 'DataSHIELD' Server Side Base Functions} +\description{ +Base 'DataSHIELD' functions for the server side. 'DataSHIELD' is a software package which allows you to do non-disclosive federated analysis on sensitive data. 'DataSHIELD' analytic functions have been designed to only share non disclosive summary statistics, with built in automated output checking based on statistical disclosure control. With data sites setting the threshold values for the automated output checks. For more details, see 'citation("dsBase")'. +} +\author{ +\strong{Maintainer}: Stuart Wheater \email{stuart.wheater@arjuna.com} (\href{https://orcid.org/0009-0003-2419-1964}{ORCID}) + +Authors: +\itemize{ + \item Paul Burton (\href{https://orcid.org/0000-0001-5799-9634}{ORCID}) + \item Rebecca Wilson (\href{https://orcid.org/0000-0003-2294-593X}{ORCID}) + \item Olly Butters (\href{https://orcid.org/0000-0003-0354-8461}{ORCID}) + \item Patricia Ryser-Welch (\href{https://orcid.org/0000-0002-0070-0264}{ORCID}) + \item Alex Westerberg + \item Leire Abarrategui + \item Roberto Villegas-Diaz (\href{https://orcid.org/0000-0001-5036-8661}{ORCID}) + \item Demetris Avraam (\href{https://orcid.org/0000-0001-8908-2441}{ORCID}) + \item Yannick Marcon \email{yannick.marcon@obiba.org} (\href{https://orcid.org/0000-0003-0138-2023}{ORCID}) + \item Tom Bishop + \item Amadou Gaye (\href{https://orcid.org/0000-0002-1180-2792}{ORCID}) + \item Xavier Escribà-Montagut (\href{https://orcid.org/0000-0003-2888-8948}{ORCID}) +} + +} +\keyword{internal} diff --git a/man/gamlssDS.Rd b/man/gamlssDS.Rd index f4cb1568..218eb4ac 100644 --- a/man/gamlssDS.Rd +++ b/man/gamlssDS.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/gamlssDS.R \name{gamlssDS} \alias{gamlssDS} -\title{gamlssDS an aggregate function called by ds.galmss} +\title{gamlssDS an aggregate function called by ds.gamlss} \usage{ gamlssDS( formula = formula, diff --git a/man/glmerSLMADS.assign.Rd b/man/glmerSLMADS.assign.Rd index f40c8f05..6db1196d 100644 --- a/man/glmerSLMADS.assign.Rd +++ b/man/glmerSLMADS.assign.Rd @@ -63,7 +63,7 @@ glmerSLMADS.assign is a serverside function called by ds.glmerSLMA on the client The analytic work engine is the glmer function in R which sits in the lme4 package. glmerSLMADS.assign fits a generalized linear mixed effects model (glme) - e.g. a logistic or Poisson regression model including both fixed and random effects - on data -from each single data source and saves the regression outcomes on the serveside. +from each single data source and saves the regression outcomes on the serverside. } \author{ Demetris Avraam for DataSHIELD Development Team diff --git a/man/hetcorDS.Rd b/man/hetcorDS.Rd index 3af57873..2745ce65 100644 --- a/man/hetcorDS.Rd +++ b/man/hetcorDS.Rd @@ -38,7 +38,7 @@ FALSE for two-step estimates. This function is based on the hetcor function from the R package \code{polycor}. } \details{ -Computes a heterogenous correlation matrix, consisting of Pearson product-moment +Computes a heterogeneous correlation matrix, consisting of Pearson product-moment correlations between numeric variables, polyserial correlations between numeric and ordinal variables, and polychoric correlations between ordinal variables. } diff --git a/man/lexisDS2.Rd b/man/lexisDS2.Rd index 9b943bb1..51ca6851 100644 --- a/man/lexisDS2.Rd +++ b/man/lexisDS2.Rd @@ -52,7 +52,7 @@ The second serverside function called by ds.lexis. \details{ This is the assign function which actually creates -the expanded dataframe containing surival data for a piecewise exponential +the expanded dataframe containing survival data for a piecewise exponential regression. lexisDS2 also carries out a series of disclosure checks and if the arguments or data fail any of those tests, diff --git a/man/lmerSLMADS.assign.Rd b/man/lmerSLMADS.assign.Rd index eb8c34bd..cc2ff9f0 100644 --- a/man/lmerSLMADS.assign.Rd +++ b/man/lmerSLMADS.assign.Rd @@ -41,14 +41,14 @@ writes lmerMod object summarising the fitted model to the serverside. For more detailed information see help for ds.lmerSLMA. } \description{ -lmerSLMADS.assing is the same as lmerSLMADS2 which fits a linear +lmerSLMADS.assign is the same as lmerSLMADS2 which fits a linear mixed effects model (lme) per study and saves the outcomes in each study } \details{ lmerSLMADS.assign is a serverside function called by ds.lmerSLMA on the clientside. The analytic work engine is the lmer function in R which sits in the lme4 package. lmerSLMADS.assign fits a linear mixed effects model (lme) including both fixed and random -effects - on data from each single data source and saves the regression outcomes on the serveside. +effects - on data from each single data source and saves the regression outcomes on the serverside. } \author{ TDemetris Avraam for DataSHIELD Development Team diff --git a/man/mdPatternDS.Rd b/man/mdPatternDS.Rd new file mode 100644 index 00000000..1084565e --- /dev/null +++ b/man/mdPatternDS.Rd @@ -0,0 +1,54 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/mdPatternDS.R +\name{mdPatternDS} +\alias{mdPatternDS} +\title{Missing data pattern with disclosure control} +\usage{ +mdPatternDS(x) +} +\arguments{ +\item{x}{a character string specifying the name of a data frame or matrix +containing the data to analyze for missing patterns.} +} +\value{ +A list containing: +\item{pattern}{The missing data pattern matrix with disclosure control applied} +\item{valid}{Logical indicating if all patterns meet disclosure requirements} +\item{message}{A message describing the validity status} +} +\description{ +This function is a serverside aggregate function that computes the +missing data pattern using mice::md.pattern and applies disclosure control to +prevent revealing small cell counts. +} +\details{ +This function calls the mice::md.pattern function to generate a matrix +showing the missing data patterns in the input data. To ensure disclosure control, +any pattern counts that are below the threshold (nfilter.tab, default=3) are +suppressed. + +\strong{Suppression Method:} + +When a pattern count is below threshold: +- Row name is changed to "suppressed()" where N is the threshold +- All pattern values in that row are set to NA +- Summary row is also set to NA (prevents back-calculation) + +\strong{Output Matrix Structure:} + +- Rows represent different missing data patterns (plus a summary row at the bottom) +- Row names contain pattern counts (or "suppressed()" for invalid patterns) +- Columns show 1 if variable is observed, 0 if missing +- Last column shows total number of missing values per pattern +- Last row shows total number of missing values per variable + +\strong{Note for Pooling:} + +When this function is called from ds.mdPattern with type='combine', suppressed +patterns are excluded from pooling to prevent disclosure through subtraction. +This means pooled counts may underestimate the true total when patterns are +suppressed in some studies. +} +\author{ +Xavier Escribà montagut for DataSHIELD Development Team +} diff --git a/man/meanDS.Rd b/man/meanDS.Rd index 94e1d7c8..6802ad58 100644 --- a/man/meanDS.Rd +++ b/man/meanDS.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/meanDS.R \name{meanDS} \alias{meanDS} -\title{Computes statistical mean of a vectores} +\title{Computes statistical mean of a vector} \usage{ meanDS(xvect) } diff --git a/man/metadataDS.Rd b/man/metadataDS.Rd index 0c636b46..f7749090 100644 --- a/man/metadataDS.Rd +++ b/man/metadataDS.Rd @@ -11,7 +11,7 @@ metadataDS(x) } \value{ a list containing the metadata. The elements of the list will depend -on the meatadata available. +on the metadata available. } \description{ This function returns metadata, if any, about specified variable. diff --git a/man/qlsplineDS.Rd b/man/qlsplineDS.Rd index cdf88ddd..aa14326a 100644 --- a/man/qlsplineDS.Rd +++ b/man/qlsplineDS.Rd @@ -10,7 +10,7 @@ qlsplineDS(x = x, q = q, na.rm = TRUE, marginal = FALSE, names = NULL) \item{x}{the name of the input numeric variable} \item{q}{numeric, a single scalar greater or equal to 2 for a number of equal-frequency -intervals along x or a vector of numbers in (0; 1) specifying the quantiles explicitely.} +intervals along x or a vector of numbers in (0; 1) specifying the quantiles explicitly.} \item{na.rm}{logical, whether NA should be removed when calculating quantiles, passed to na.rm of quantile. Default set to TRUE.} diff --git a/man/repDS.Rd b/man/repDS.Rd index 5d410418..306e2aec 100644 --- a/man/repDS.Rd +++ b/man/repDS.Rd @@ -30,7 +30,7 @@ help for " (see above). This parameter is usually fully defined by the argument in the call to \code{ds.rep} that itself calls \code{repDS}.} \item{length.out.transmit}{This argument fixes the length of -the output repetive sequence vector +the output repetitive sequence vector For behaviour see help for \code{ds.rep} and "details from native R help for " (see above). This parameter is usually fully defined by the argument in the call to \code{ds.rep} that itself calls \code{repDS}.} diff --git a/man/rmDS.Rd b/man/rmDS.Rd index 18d85255..f4d13286 100644 --- a/man/rmDS.Rd +++ b/man/rmDS.Rd @@ -8,7 +8,7 @@ rmDS(x.names.transmit) } \arguments{ \item{x.names.transmit, }{the names of the objects to be deleted converted -into transmissable form, a comma seperated list of character string. The +into transmissible form, a comma separated list of character string. The argument is specified via the argument of ds.rm} } \value{ diff --git a/man/table1DDS.Rd b/man/table1DDS.Rd index 950ff239..98bb8750 100644 --- a/man/table1DDS.Rd +++ b/man/table1DDS.Rd @@ -21,7 +21,7 @@ This function generates a 1-dimensional table where potentially disclosive cells It generates a 1-dimensional tables where valid (non-disclosive) 1-dimensional tables are defined as data from sources where no table cells have counts between 1 and the set threshold. When the output table is invalid all cells but the total count are replaced by missing values. Only the total count is visible -on the table returned to the client site. A message is also returned with the 1-dimensional; the message +on the table returned to the client side. A message is also returned with the 1-dimensional; the message says "invalid table - invalid counts present" if the table is invalid and 'valid table' otherwise. } \author{ diff --git a/man/tableDS.Rd b/man/tableDS.Rd index a6ac5a45..752eb815 100644 --- a/man/tableDS.Rd +++ b/man/tableDS.Rd @@ -18,17 +18,17 @@ tableDS( ) } \arguments{ -\item{rvar.transmit}{is a character string (in inverted commas) specifiying the +\item{rvar.transmit}{is a character string (in inverted commas) specifying the name of the variable defining the rows in all of the 2 dimensional tables that form the output. Fully specified by argument in \code{ds.table}. For more information see help for \code{ds.table}} -\item{cvar.transmit}{is a character string specifiying the +\item{cvar.transmit}{is a character string specifying the name of the variable defining the columns in all of the 2 dimensional tables that form the output. Fully specified by argument in \code{ds.table}. For more information see help for \code{ds.table}} -\item{stvar.transmit}{is a character string specifiying the +\item{stvar.transmit}{is a character string specifying the name of the variable that indexes the separate two dimensional tables in the output if the call specifies a 3 dimensional table. Fully specified by argument in \code{ds.table}. diff --git a/man/tableDS.assign.Rd b/man/tableDS.assign.Rd index 7a79e36a..8214ab3d 100644 --- a/man/tableDS.assign.Rd +++ b/man/tableDS.assign.Rd @@ -17,17 +17,17 @@ tableDS.assign( ) } \arguments{ -\item{rvar.transmit}{is a character string (in inverted commas) specifiying the +\item{rvar.transmit}{is a character string (in inverted commas) specifying the name of the variable defining the rows in all of the 2 dimensional tables that form the output. Fully specified by argument in \code{ds.table}. For more information see help for \code{ds.table}} -\item{cvar.transmit}{is a character string specifiying the +\item{cvar.transmit}{is a character string specifying the name of the variable defining the columns in all of the 2 dimensional tables that form the output. Fully specified by argument in \code{ds.table}. For more information see help for \code{ds.table}} -\item{stvar.transmit}{is a character string specifiying the +\item{stvar.transmit}{is a character string specifying the name of the variable that indexes the separate two dimensional tables in the output if the call specifies a 3 dimensional table. Fully specified by argument in \code{ds.table}. diff --git a/man/tableDS2.Rd b/man/tableDS2.Rd index 38f6c5e8..86e27027 100644 --- a/man/tableDS2.Rd +++ b/man/tableDS2.Rd @@ -15,17 +15,17 @@ is nevertheless TRUE, the name for the serverside table object defaults to 'newObj'. Fully specified by argument in \code{ds.table}. For more information see help for \code{ds.table}} -\item{rvar.transmit}{is a character string (in inverted commas) specifiying the +\item{rvar.transmit}{is a character string (in inverted commas) specifying the name of the variable defining the rows in all of the 2 dimensional tables that form the output. Fully specified by argument in \code{ds.table}. For more information see help for \code{ds.table}} -\item{cvar.transmit}{is a character string specifiying the +\item{cvar.transmit}{is a character string specifying the name of the variable defining the columns in all of the 2 dimensional tables that form the output. Fully specified by argument in \code{ds.table}. For more information see help for \code{ds.table}} -\item{stvar.transmit}{is a character string specifiying the +\item{stvar.transmit}{is a character string specifying the name of the variable that indexes the separate two dimensional tables in the output if the call specifies a 3 dimensional table. Fully specified by argument in \code{ds.table}. diff --git a/tests/testthat/perf_tests/perf_rate.R b/tests/testthat/perf_tests/perf_rate.R index 1884cda8..64b638db 100644 --- a/tests/testthat/perf_tests/perf_rate.R +++ b/tests/testthat/perf_tests/perf_rate.R @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------- -# Copyright (c) 2024 Arjuna Technologies, Newcastle upon Tyne. All rights reserved. +# Copyright (c) 2024-2025 Arjuna Technologies, Newcastle upon Tyne. All rights reserved. # # This program and the accompanying materials # are made available under the terms of the GNU Public License v3.0. @@ -8,7 +8,8 @@ # along with this program. If not, see . #------------------------------------------------------------------------------- -.perf.reference.filename <- 'perf_files/default_perf_profile.csv' +.perf.reference.filename <- 'perf_files/default_perf_profile.csv' +.perf.reference.save.filename <- NULL .perf.reference <- NULL @@ -22,7 +23,13 @@ perf.reference.save <- function(perf.ref.name, rate, tolerance.lower, tolerance. .perf.reference[nrow(.perf.reference)+1,] <- c(perf.ref.name, rate, tolerance.lower, tolerance.upper) - write.csv(.perf.reference, .perf.reference.filename, row.names = FALSE) + if (is.null(.perf.reference.save.filename)) + { + .perf.reference.save.filename <<- base::tempfile(pattern = "perf_file_", fileext = ".csv") + message(paste0("Additional perf record added to '", .perf.reference.save.filename, "'")) + } + + write.csv(.perf.reference, .perf.reference.save.filename, row.names = FALSE) .perf.reference <<- .perf.reference } @@ -47,4 +54,3 @@ perf.reference.tolerance.upper <- function(perf.ref.name) { return(as.numeric(.perf.reference[which(.perf.reference$refer_name == perf.ref.name),]$upper_tolerance)) } - diff --git a/tests/testthat/test-arg-mdPatternDS.R b/tests/testthat/test-arg-mdPatternDS.R new file mode 100644 index 00000000..bea53d22 --- /dev/null +++ b/tests/testthat/test-arg-mdPatternDS.R @@ -0,0 +1,43 @@ +#------------------------------------------------------------------------------- +# Copyright (c) 2025 ProPASS Consortium. All rights reserved. +# +# This program and the accompanying materials +# are made available under the terms of the GNU Public License v3.0. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +#------------------------------------------------------------------------------- + +# +# Set up +# + +context("mdPatternDS::arg::setup") + +set.standard.disclosure.settings() + +# +# Tests +# + +context("mdPatternDS::arg::x NULL") +test_that("mdPatternDS x NULL", { + x <- NULL + + expect_error(mdPatternDS(x), "The input object must be of type 'data.frame' or 'matrix'. Current type: NULL") +}) + +context("mdPatternDS::arg::x not valid variable") +test_that("mdPatternDS x not variable", { + x <- "not a variable" + + expect_error(mdPatternDS(x), "Object 'not a variable' does not exist on the server") +}) + +# +# Done +# + +context("mdPatternDS::arg::shutdown") + +context("mdPatternDS::arg::done") diff --git a/tests/testthat/test-disc-mdPatternDS.R b/tests/testthat/test-disc-mdPatternDS.R new file mode 100644 index 00000000..055974cc --- /dev/null +++ b/tests/testthat/test-disc-mdPatternDS.R @@ -0,0 +1,69 @@ +#------------------------------------------------------------------------------- +# Copyright (c) 2025 ProPASS Consortium. All rights reserved. +# +# This program and the accompanying materials +# are made available under the terms of the GNU Public License v3.0. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +#------------------------------------------------------------------------------- + +# +# Set up +# + +context("mdPatternDS::disc::setup") + +set.standard.disclosure.settings() + +# +# Tests +# + +context("mdPatternDS::disc::sample incomplete data.frame") +test_that("mdPatternDS: sample incomplete data.frame", { + x_val <- data.frame(v1 = c(0.0, NA, 2.0, 3.0, 4.0, 5.0, 6.0), v2 = c(6.0, 5.0, 4.0, 3.0, 2.0, 1.0, 0.0)) + x <- "x_val" + + res <- mdPatternDS(x) + + expect_length(res, 3) + expect_length(class(res), 1) + expect_true(all(class(res) %in% c("list"))) + expect_length(class(res$pattern), 2) + expect_true(all(class(res$pattern) %in% c("matrix", "array"))) + + expect_length(colnames(res$pattern), 3) + expect_equal(colnames(res$pattern)[1], "v2") + expect_equal(colnames(res$pattern)[2], "v1") + expect_equal(colnames(res$pattern)[3], "") + expect_length(rownames(res$pattern), 3) + expect_equal(rownames(res$pattern)[1], "6") + expect_equal(rownames(res$pattern)[2], "suppressed(<3)") + expect_equal(rownames(res$pattern)[3], "") + + expect_equal(res$pattern[1, 1], 1) + expect_equal(res$pattern[1, 2], 1) + expect_equal(res$pattern[1, 3], 0) + expect_true(is.na(res$pattern[2, 1])) + expect_true(is.na(res$pattern[2, 2])) + expect_true(is.na(res$pattern[2, 3])) + expect_true(is.na(res$pattern[3, 1])) + expect_true(is.na(res$pattern[3, 2])) + expect_true(is.na(res$pattern[3, 3])) + + expect_length(class(res$valid), 1) + expect_true(all(class(res$valid) %in% c("logical"))) + expect_false(res$valid) + expect_length(class(res$message), 1) + expect_true(all(class(res$message) %in% c("character"))) + expect_equal(res$message, "Invalid: some pattern counts below threshold (3) have been suppressed") +}) + +# +# Done +# + +context("mdPatternDS::disc::shutdown") + +context("mdPatternDS::disc::done") diff --git a/tests/testthat/test-smk-corTestDS.R b/tests/testthat/test-smk-corTestDS.R index be006fe4..a36e2082 100644 --- a/tests/testthat/test-smk-corTestDS.R +++ b/tests/testthat/test-smk-corTestDS.R @@ -182,7 +182,7 @@ test_that("simple corTestDS, some, pearson, without na, pearson", { context("corTestDS::smk::with na, pearson") test_that("simple corTestDS, some, with na, pearson", { - x <- c(0.0, NA, 2.0, 3.0, NA, 5.0, NA, 7.0) + x <- c(NA, 1.0, 2.0, 3.0, NA, 5.0, NA, 7.0) y <- c(0.0, 1.0, NA, 3.0, 4.0, NA, NA, 7.0) res <- corTestDS("x", "y", "pearson", NULL, 0.95) @@ -608,3 +608,4 @@ test_that("simple corTestDS, some, with na, spearman", { context("corTestDS::smk::shutdown") context("corTestDS::smk::done") + diff --git a/tests/testthat/test-smk-mdPatternDS.R b/tests/testthat/test-smk-mdPatternDS.R new file mode 100644 index 00000000..6cbe0062 --- /dev/null +++ b/tests/testthat/test-smk-mdPatternDS.R @@ -0,0 +1,103 @@ +#------------------------------------------------------------------------------- +# Copyright (c) 2025 ProPASS Consortium. All rights reserved. +# +# This program and the accompanying materials +# are made available under the terms of the GNU Public License v3.0. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +#------------------------------------------------------------------------------- + +# +# Set up +# + +context("mdPatternDS::smk::setup") + +set.standard.disclosure.settings() + +# +# Tests +# + +context("mdPatternDS::smk::sample 1 complete data.frame") +test_that("mdPatternDS: sample 1 complete data.frame", { + x_val <- data.frame(v1 = c(0.0, 1.0, 2.0, 3.0, 4.0), v2 = c(4.0, 3.0, 2.0, 1.0, 0.0)) + x <- "x_val" + + res <- mdPatternDS(x) + + expect_length(res, 3) + expect_length(class(res), 1) + expect_true(all(class(res) %in% c("list"))) + expect_length(class(res$pattern), 2) + expect_true(all(class(res$pattern) %in% c("matrix", "array"))) + + expect_length(colnames(res$pattern), 3) + expect_equal(colnames(res$pattern)[1], "v1") + expect_equal(colnames(res$pattern)[2], "v2") + expect_equal(colnames(res$pattern)[3], "") + expect_length(rownames(res$pattern), 2) + expect_equal(rownames(res$pattern)[1], "5") + expect_equal(rownames(res$pattern)[2], "") + + expect_equal(res$pattern[1, 1], 1) + expect_equal(res$pattern[1, 2], 1) + expect_equal(res$pattern[1, 3], 0) + expect_equal(res$pattern[2, 1], 0) + expect_equal(res$pattern[2, 2], 0) + expect_equal(res$pattern[2, 3], 0) + + expect_length(class(res$valid), 1) + expect_true(all(class(res$valid) %in% c("logical"))) + expect_true(res$valid) + expect_length(class(res$message), 1) + expect_true(all(class(res$message) %in% c("character"))) + expect_equal(res$message, "Valid: all pattern counts meet disclosure requirements") +}) + + +context("mdPatternDS::smk::sample 2 complete data.frame") +test_that("mdPatternDS: sample 2 complete data.frame", { + x_val <- data.frame(v1 = c(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0), v2 = c(9.0, 8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0, 0.0)) + x <- "x_val" + + res <- mdPatternDS(x) + + expect_length(res, 3) + expect_length(class(res), 1) + expect_true(all(class(res) %in% c("list"))) + expect_length(class(res$pattern), 2) + expect_true(all(class(res$pattern) %in% c("matrix", "array"))) + + expect_length(colnames(res$pattern), 3) + expect_equal(colnames(res$pattern)[1], "v1") + expect_equal(colnames(res$pattern)[2], "v2") + expect_equal(colnames(res$pattern)[3], "") + expect_length(rownames(res$pattern), 2) + expect_equal(rownames(res$pattern)[1], "10") + expect_equal(rownames(res$pattern)[2], "") + expect_true(is.na(rownames(res$pattern)[3])) + + expect_equal(res$pattern[1, 1], 1) + expect_equal(res$pattern[1, 2], 1) + expect_equal(res$pattern[1, 3], 0) + expect_equal(res$pattern[2, 1], 0) + expect_equal(res$pattern[2, 2], 0) + expect_equal(res$pattern[2, 3], 0) + + expect_length(class(res$valid), 1) + expect_true(all(class(res$valid) %in% c("logical"))) + expect_true(res$valid) + expect_length(class(res$message), 1) + expect_true(all(class(res$message) %in% c("character"))) + expect_equal(res$message, "Valid: all pattern counts meet disclosure requirements") +}) + +# +# Done +# + +context("mdPatternDS::smk::shutdown") + +context("mdPatternDS::smk::done")