Skip to content

Commit f0cae98

Browse files
committed
fix: unwrap new list returns in ds.summary
1 parent 30976f1 commit f0cae98

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

R/ds.summary.R

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ ds.summary <- function(x=NULL, datasources=NULL){
9191
validity <- DSI::datashield.aggregate(datasources[i], as.symbol(paste0('isValidDS(', x, ')')))[[1]]
9292
if(validity){
9393
dims <- DSI::datashield.aggregate(datasources[i], call('dimDS', x))
94-
r <- dims[[1]][1]
95-
c <- dims[[1]][2]
94+
r <- dims[[1]]$dim[1]
95+
c <- dims[[1]]$dim[2]
9696
cols <- (DSI::datashield.aggregate(datasources[i], call('colnamesDS', x)))[[1]]
9797
stdsummary <- list('class'=typ, 'number of rows'=r, 'number of columns'=c, 'variables held'=cols)
9898
finalOutput[[i]] <- stdsummary
@@ -107,7 +107,7 @@ ds.summary <- function(x=NULL, datasources=NULL){
107107
for(i in 1:numsources){
108108
validity <- DSI::datashield.aggregate(datasources[i], as.symbol(paste0('isValidDS(', x, ')')))[[1]]
109109
if(validity){
110-
l <- DSI::datashield.aggregate(datasources[i], call('lengthDS', x))[[1]]
110+
l <- DSI::datashield.aggregate(datasources[i], call('lengthDS', x))[[1]]$length
111111
stdsummary <- list('class'=typ, 'length'=l)
112112
finalOutput[[i]] <- stdsummary
113113
}else{
@@ -121,8 +121,8 @@ ds.summary <- function(x=NULL, datasources=NULL){
121121
for(i in 1:numsources){
122122
validity <- DSI::datashield.aggregate(datasources[i], as.symbol(paste0('isValidDS(', x, ')')))[[1]]
123123
if(validity){
124-
l <- DSI::datashield.aggregate(datasources[i], call('lengthDS', x))[[1]]
125-
levels.resp <- DSI::datashield.aggregate(datasources[i], as.symbol(paste0('levelsDS(', x, ')' )))[[1]]
124+
l <- DSI::datashield.aggregate(datasources[i], call('lengthDS', x))[[1]]$length
125+
levels.resp <- DSI::datashield.aggregate(datasources[i], call('levelsDS', x))[[1]]
126126
categories <- levels.resp$Levels
127127
freq <- DSI::datashield.aggregate(datasources[i], as.symbol(paste0('table1DDS(', x, ')' )))[[1]][1]
128128
stdsummary <- list('class'=typ, 'length'=l, 'categories'=categories)
@@ -142,8 +142,8 @@ ds.summary <- function(x=NULL, datasources=NULL){
142142
for(i in 1:numsources){
143143
validity <- DSI::datashield.aggregate(datasources[i], as.symbol(paste0('isValidDS(', x, ')')))[[1]]
144144
if(validity){
145-
l <- DSI::datashield.aggregate(datasources[i], call('lengthDS', x))[[1]]
146-
q <- (DSI::datashield.aggregate(datasources[i], as.symbol(paste0('quantileMeanDS(', x, ')' ))))[[1]]
145+
l <- DSI::datashield.aggregate(datasources[i], call('lengthDS', x))[[1]]$length
146+
q <- (DSI::datashield.aggregate(datasources[i], call('quantileMeanDS', x)))[[1]]$quantiles
147147
stdsummary <- list('class'=typ, 'length'=l, 'quantiles & mean'=q)
148148
finalOutput[[i]] <- stdsummary
149149
}else{
@@ -156,7 +156,7 @@ ds.summary <- function(x=NULL, datasources=NULL){
156156

157157
if("list" %in% typ){
158158
for(i in 1:numsources){
159-
l <- DSI::datashield.aggregate(datasources[i], call('lengthDS', x))[[1]]
159+
l <- DSI::datashield.aggregate(datasources[i], call('lengthDS', x))[[1]]$length
160160
elts <- DSI::datashield.aggregate(datasources[i], call('namesDS', x))
161161
if(length(elts) == 0){
162162
elts <- NULL
@@ -177,7 +177,7 @@ ds.summary <- function(x=NULL, datasources=NULL){
177177
for(i in 1:numsources){
178178
validity <- DSI::datashield.aggregate(datasources[i], as.symbol(paste0('isValidDS(', x, ')')))[[1]]
179179
if(validity){
180-
l <- DSI::datashield.aggregate(datasources[i], call('lengthDS', x))[[1]]
180+
l <- DSI::datashield.aggregate(datasources[i], call('lengthDS', x))[[1]]$length
181181
freq <- DSI::datashield.aggregate(datasources[i], as.symbol(paste0('table1DDS(', x, ')' )))[[1]][1]
182182
stdsummary <- list('class'=typ, 'length'=l)
183183
for(j in 1:length(2)){

0 commit comments

Comments
 (0)