@@ -1441,11 +1441,50 @@ output$attrcheck <- renderUI({
14411441})
14421442outputOptions(output , " attrcheck" , suspendWhenHidden = FALSE )
14431443
1444- output $ attrtbl <- renderDataTable({
1444+ output $ attrtbl_lg <- renderDataTable({
14451445 dt <- nwdf()[, c(" Names" , input $ attrcols )]
14461446 dt
14471447}, options = list (pageLength = 10 ))
14481448
1449+ output $ attrtbl_sm <- renderPrint({
1450+ ntbl <- length(input $ attrcols )
1451+ if (ntbl == 0 ){return ()}
1452+ attrname <- input $ attrcols
1453+ tbl_list <- list ()
1454+ if (ntbl == 1 ){
1455+ lvls <- length(unique(nwdf()[[attrname ]]))
1456+ if (attrname %in% numattr() & lvls > 9 ){
1457+ tab <- hist(nwdf()[[attrname ]], breaks = 10 , plot = FALSE )
1458+ barname <- paste(tab $ breaks [1 : 2 ], collapse = " -" )
1459+ for (i in seq(length(tab $ breaks ) - 2 )){
1460+ barname <- append(barname , paste(tab $ breaks [i + 1 ]+ 1 , tab $ breaks [i + 2 ], sep = " -" ))
1461+ }
1462+ tab <- tab $ counts
1463+ names(tab ) <- barname
1464+ } else {
1465+ tab <- table(nwdf()[[attrname ]])
1466+ }
1467+ tbl_list [[attrname ]] <- tab
1468+ } else {
1469+ for (a in attrname ){
1470+ lvls <- length(unique(nwdf()[[a ]]))
1471+ if (a %in% numattr() & lvls > 9 ){
1472+ tab <- hist(nwdf()[[a ]], breaks = 10 , plot = FALSE )
1473+ barname <- paste(tab $ breaks [1 : 2 ], collapse = " -" )
1474+ for (i in seq(length(tab $ breaks ) - 2 )){
1475+ barname <- append(barname , paste(tab $ breaks [i + 1 ]+ 1 , tab $ breaks [i + 2 ], sep = " -" ))
1476+ }
1477+ tab <- tab $ counts
1478+ names(tab ) <- barname
1479+ } else {
1480+ tab <- table(nwdf()[[a ]])
1481+ }
1482+ tbl_list [[a ]] <- tab
1483+ }
1484+ }
1485+ tbl_list
1486+ })
1487+
14491488output $ attrhist <- renderPlot({
14501489 nplots <- length(input $ attrcols )
14511490 if (nplots == 0 ){return ()}
@@ -1458,7 +1497,8 @@ output$attrhist <- renderPlot({
14581497 col = " #076EC3" , lwd = 2 )
14591498 } else {
14601499 if (attrname %in% numattr() & lvls > 9 ){
1461- tab <- hist.info(nwdf()[[attrname ]], breaks = 10 )
1500+ out <- hist.info(nwdf()[[attrname ]], breaks = 10 )
1501+ tab <- out $ counts
14621502 } else {
14631503 tab <- table(nwdf()[[attrname ]])
14641504 }
0 commit comments