33# ' @description Server-side function called by ds.meanSdGp
44# ' @details Computes the mean and standard deviation across groups defined by one
55# ' factor
6- # ' @param X a client-side supplied character string identifying the variable for which
6+ # ' @param x a client-side supplied character string identifying the variable for which
77# ' means/SDs are to be calculated
8- # ' @param INDEX a client-side supplied character string identifying the factor across
8+ # ' @param index a client-side supplied character string identifying the factor across
99# ' which means/SDs are to be calculated
1010# ' @author Burton PR
11- # '
11+ # '
1212# ' @return List with results from the group statistics
1313# ' @export
1414# '
15- meanSdGpDS <- function (X , INDEX ){
16-
15+ meanSdGpDS <- function (x , index ){
16+
1717 # ############################################################
1818 # MODULE 1: CAPTURE THE nfilter SETTINGS
1919 thr <- dsBase :: listDisclosureSettingsDS()
@@ -23,9 +23,14 @@ meanSdGpDS <- function (X, INDEX){
2323 # nfilter.string <- as.numeric(thr$nfilter.string)
2424 # ############################################################
2525
26+ X <- .loadServersideObject(x )
27+ .checkClass(obj = X , obj_name = x , permitted_classes = c(" numeric" , " integer" ))
28+ INDEX <- .loadServersideObject(index )
29+ .checkClass(obj = INDEX , obj_name = index , permitted_classes = c(" factor" , " character" , " integer" ))
30+
2631 FUN.mean <- function (x ) {mean(x ,na.rm = TRUE )}
2732 FUN.var <- function (x ) {stats :: var(x ,na.rm = TRUE )}
28-
33+
2934 # Strip missings from both X and INDEX
3035 analysis.matrix <- cbind(X ,INDEX )
3136
0 commit comments