Learn R Programming

dsBase: 'DataSHIELD' Server Side Base Functions

Installation

You can install the released version of dsBase from CRAN with:

install.packages("dsBase")

And the development version from GitHub with:

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:

LocationWhat is it?
obiba CRANWhere you probably should install DataSHIELD from.
releasesStable releases.
master branchMostly 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. 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

Copy Link

Version

Install

install.packages('dsBase')

Monthly Downloads

267

Version

6.3.5

License

GPL-3

Maintainer

Stuart Wheater

Last Published

February 22nd, 2026

Functions in dsBase (6.3.5)

aucDS

aucDS an aggregate function called by ds.auc
asNumericDS

Coerces an R object into class numeric
boxPlotGG_data_Treatment_numericDS

Arrange vector to pass it to the boxplot function
asMatrixDS

Coerces an R object into a matrix
bp_standardsDS

Calculates Blood pressure z-scores
cDS

Concatenates objects into a vector or list
corTestDS

Tests for correlation between paired samples
changeRefGroupDS

Changes a reference level of a factor
elsplineDS

Basis for a piecewise linear spline with meaningful coefficients
cbindDS

cbindDS called by ds.cbind
dsBase-package

dsBase: 'DataSHIELD' Server Side Base Functions
classDS

Returns the class of an object
colnamesDS

Returns the column names of a data frame or matrix
dimDS

Returns the dimension of a data frame or matrix
dmtC2SDS

Copy a clientside data.frame, matrix or tibble (DMT) to the serverside.
dataFrameSubsetDS2

dataFrameSubsetDS2 an assign function called by ds.dataFrameSubset
densityGridDS

Generates a density grid with or without a priori defined limits
covDS

Computes the sum of each variable and the sum of products for each pair of variables
dataFrameDS

dataFrameDS called by ds.dataFrame
dataFrameFillDS

dataFrameFillDS
glmPredictDS.as

predict regression responses from a glm object
glmDS2

glmDS2 called by ds.glm
glmPredictDS.ag

predict regression responses from a glm object
glmDS1

glmDS1 called by ds.glm
checkNegValueDS

Checks if a numeric variable has negative values
corDS

Computes the sum of each variable and the sum of products for each pair of variables
gamlssDS

gamlssDS an aggregate function called by ds.gamlss
completeCasesDS

completeCasesDS: an assign function called by ds.completeCases
getWGSRDS

Computes the WHO Growth Reference z-scores of anthropometric data
dataFrameSubsetDS1

dataFrameSubsetDS1 an aggregate function called by ds.dataFrameSubset
dataFrameSortDS

Sorting and reordering data frames, vectors or matrices
checkPermissivePrivacyControlLevel

checkPermissivePrivacyControlLevel
hetcorDS

Heterogeneous Correlation Matrix
glmerSLMADS.assign

Fitting generalized linear mixed effect models - serverside function
glmSummaryDS.as

summarize a glm object on the serverside
glmSummaryDS.ag

summarize a glm object on the serverside
glmSLMADS.assign

Fit a Generalized Linear Model (GLM) with pooling via Study Level Meta-Analysis (SLMA)
glmSLMADS1

Fit a Generalized Linear Model (GLM) with pooling via Study Level Meta-Analysis (SLMA)
glmSLMADS2

Fit a Generalized Linear Model (GLM) with pooling via Study Level Meta-Analysis (SLMA)
isNaDS

Checks if a vector is empty
isValidDS

Checks if an input is valid
lengthDS

Returns the length of a vector or list
levelsDS

Returns the levels of a factor vector
histogramDS1

returns the minimum and the maximum of the input numeric vector
lsDS

lists all objects on a serverside environment
lmerSLMADS2

Fitting linear mixed effect models - serverside function
lexisDS1

lexisDS1
lexisDS2

lexisDS2
matrixDiagDS

matrixDiagDS assign function called by ds.matrixDiag
mergeDS

mergeDS (assign function) called by ds.merge
messageDS

messageDS
matrixDetDS1

matrixDetDS aggregate function called by ds.matrixDet.report
matrixInvertDS

matrixInvertDS serverside assign function called by ds.matrixInvert
matrixDetDS2

matrixDetDS assign function called by ds.matrixDet
matrixDimnamesDS

matrixDimnamesDS assign function called by ds.matrixDimnames
extractQuantilesDS2

Secure ranking of "V2BR" (vector to be ranked) across all sources and use of these ranks to estimate global quantiles across all studies
extractQuantilesDS1

Secure ranking of "V2BR" (vector to be ranked) across all sources and use of these ranks to estimate global quantiles across all studies
lmerSLMADS.assign

Fitting linear mixed effect models - serverside function
metadataDS

Returns the metadata, if any, about the specified variable
listDisclosureSettingsDS

listDisclosureSettingsDS
histogramDS2

Computes a histogram of the input variable without plotting.
numNaDS

Counts the number of missing values
nsDS

Generate a Basis Matrix for Natural Cubic Splines
miceDS

Aggregate function called by ds.mice
rBinomDS

rBinomDS serverside assign function
meanDS

Computes statistical mean of a vector
meanSdGpDS

MeanSdGpDS
rNormDS

rNormDS serverside assign function
kurtosisDS1

Calculates the kurtosis of a numeric variable
rPoisDS

rPoisDS serverside assign function
rangeDS

returns the minimum and maximum of a numeric vector
kurtosisDS2

Calculates the kurtosis of a numeric variable
igb_standardsDS

Converts birth measurements to intergrowth z-scores/centiles
rUnifDS

rUnifDS serverside assign function
minMaxRandDS

Secure ranking of "V2BR" (vector to be ranked) across all sources
matrixMultDS

matrixMultDS serverside assign function called by ds.matrixMult
recodeLevelsDS

Recodes the levels of a categorical variables
namesDS

Return the names of a list object
glmerSLMADS2

Fitting generalized linear mixed effect models - serverside function
lexisDS3

@title lexisDS3
lsplineDS

Basis for a piecewise linear spline with meaningful coefficients
heatmapPlotDS

Calculates the coordinates of the centroid of each n nearest neighbours
listDS

Coerce objects into a list
ranksSecureDS1

Secure ranking of "V2BR" (vector to be ranked) across all sources
matrixDS

matrixDS assign function called by ds.matrix
recodeValuesDS

recodeValuesDS an assign function called by ds.recodeValues
seqDS

seqDS a serverside assign function called by ds.seq
qlsplineDS

Basis for a piecewise linear spline with meaningful coefficients
sampleDS

random sampling and permuting of vectors, dataframes and matrices
subsetDS

Generates a valid subset of a table or a vector
scatterPlotDS

Calculates the coordinates of the data to be plot
testObjExistsDS

testObjExistsDS
tapplyDS.assign

tapplyDS.assign called by ds.tapply.assign
unListDS

unListDS a serverside assign function called by ds.unList
tapplyDS

tapplyDS called by ds.tapply
subsetByClassDS

Breaks down a dataframe or a factor into its sub-classes
matrixTransposeDS

matrixTransposeDS serverside assign function called by ds.matrixTranspose
sqrtDS

Computes the square root values of the input variable
setSeedDS

setSeedDs called by ds.setSeed, ds.rNorm, ds.rUnif, ds.rPois and ds.rBinom
mdPatternDS

Missing data pattern with disclosure control
rbindDS

rbindDS called by ds.rbind
quantileMeanDS

Generates quantiles and mean information without maximum and minimum
ranksSecureDS4

Secure ranking of "V2BR" (vector to be ranked) across all sources
ranksSecureDS5

Secure ranking of "V2BR" (vector to be ranked) across all sources
skewnessDS2

Calculates the skewness of a numeric variable
table1DDS

Creates 1-dimensional contingency tables
replaceNaDS

Replaces the missing values in a vector
repDS

repDS called by ds.rep
reShapeDS

reShapeDS (assign function) called by ds.reShape
skewnessDS1

Calculates the skewness of a numeric variable
vectorDS

Creates a vector on the server-side.
uniqueDS

Applies the unique method to a server-side variable.
varDS

Computes the variance of vector
rowColCalcDS

Computes sums and means of rows or columns of numeric arrays
ranksSecureDS2

Secure ranking of "V2BR" (vector to be ranked) across all sources
ranksSecureDS3

Secure ranking of "V2BR" (vector to be ranked) across all sources
table2DDS

table2DDS (aggregate function) called by ds.table2D
rmDS

rmDS an aggregate function called by ds.rm
tableDS.assign

tableDS.assign is the serverside assign function called by ds.table
tableDS2

tableDS is the second of two serverside aggregate functions called by ds.table
tableDS

tableDS is the first of two serverside aggregate functions called by ds.table
asCharacterDS

Coerces an R object into class character
BooleDS

BooleDS
asIntegerDS

Coerces an R object into class integer
asListDS

asListDS a serverside aggregate function called by ds.asList
asFactorDS1

Determines the levels of the input variable in each single study
asFactorSimpleDS

Converts a numeric vector into a factor
asLogicalDS

Coerces an R object into class numeric
asFactorDS2

Converts a numeric vector into a factor
absDS

Computes the absolute values of the input variable
asDataMatrixDS

asDataMatrixDS a serverside assign function called by ds.asDataMatrix
boxPlotGG_data_TreatmentDS

Arrange data frame to pass it to the boxplot function
blackBoxRanksDS

Secure ranking of "V2BR" (vector to be ranked) across all sources
boxPlotGGDS

Create the identity stats and necessary data to draw a plot on the client
blackBoxDS

Secure ranking of "V2BR" (vector to be ranked) across all sources