Skip to content

Commit dcda8f9

Browse files
committed
fix #70 print bug
1 parent 339c458 commit dcda8f9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

R/Design.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,14 @@ print.Design <- function(x, list2char = TRUE, pillar.sigfig = 5, show.IDs = FALS
224224
x <- cbind(Design.ID=attr(x, 'Design.ID'), x)
225225
class(x) <- cls
226226
}
227-
classes <- sapply(x, class)
228-
if(list2char && any(classes == 'list') && is(x, 'tbl_df'))
227+
classes <- lapply(x, class)
228+
if(list2char && any(sapply(classes, is.list)) && is(x, 'tbl_df'))
229229
x <- list2char(x)
230-
classes2 <- sapply(x, class)
230+
classes2 <- lapply(x, class)
231231
class(x) <- class(x)[!(class(x) %in% 'Design')]
232232
old <- options(pillar.sigfig=pillar.sigfig)
233-
printDesign(x, whichlist= which(classes != classes2), ...)
233+
pick <- sapply(1:length(classes), \(i) all(classes[[i]] != classes2[[i]]))
234+
printDesign(x, whichlist= which(pick), ...)
234235
options(old)
235236
invisible(NULL)
236237
}

0 commit comments

Comments
 (0)