@@ -1454,29 +1454,38 @@ output$attrhist <- renderPlot({
14541454 if (nplots == 1 ){
14551455 par(mfrow = c(1 , 1 ))
14561456 lvls <- length(unique(nwdf()[[attrname ]]))
1457- if (attrname %in% numattr() & lvls > 9 ){
1458- tab <- hist.info(nwdf()[[attrname ]], breaks = 10 )
1457+ if (input $ attrhistaxis == " density" & attrname %in% numattr() & lvls > 9 ){
1458+ plot(density(nwdf()[[attrname ]]), main = attrname ,
1459+ col = " #076EC3" , lwd = 2 )
14591460 } else {
1460- tab <- table(nwdf()[[attrname ]])
1461- }
1462- if (input $ attrhistaxis == " Percents" ){
1463- tab <- tab / sum(tab )
1461+ if (attrname %in% numattr() & lvls > 9 ){
1462+ tab <- hist.info(nwdf()[[attrname ]], breaks = 10 )
1463+ } else {
1464+ tab <- table(nwdf()[[attrname ]])
1465+ }
1466+ if (input $ attrhistaxis == " percent" ){
1467+ tab <- tab / sum(tab )
1468+ }
1469+ barplot(tab , xlab = attrname , col = histblue )
14641470 }
1465- barplot(tab , xlab = attrname , col = histblue )
14661471 } else {
14671472 r <- ceiling(nplots / 2 )
14681473 par(mfrow = c(r , 2 ))
14691474 for (a in attrname ){
14701475 lvls <- length(unique(nwdf()[[a ]]))
1471- if (a %in% numattr() & lvls > 9 ){
1476+ if (input $ attrhistaxis == " density" & a %in% numattr() & lvls > 9 ){
1477+ plot(density(nwdf()[[a ]]), main = a , col = " #076EC3" , lwd = 2 )
1478+ } else {
1479+ if (a %in% numattr() & lvls > 9 ){
14721480 tab <- hist.info(nwdf()[[a ]], breaks = 10 )
14731481 } else {
14741482 tab <- table(nwdf()[[a ]])
14751483 }
1476- if (input $ attrhistaxis == " Percents " ){
1484+ if (input $ attrhistaxis == " percent " ){
14771485 tab <- tab / sum(tab )
14781486 }
14791487 barplot(tab , xlab = a , col = histblue )
1488+ }
14801489 }
14811490 }
14821491})
0 commit comments