@@ -1441,11 +1441,33 @@ 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+ tab <- attr.info(df = nwdf(), colname = attrname ,
1456+ numattrs = numattr(), breaks = 10 )
1457+ tbl_list [[attrname ]] <- tab
1458+ } else {
1459+ for (a in attrname ){
1460+ tab <- attr.info(df = nwdf(), colname = a ,
1461+ numattrs = numattr(), breaks = 10 )
1462+ tbl_list [[a ]] <- tab
1463+ }
1464+ }
1465+ for (a in attrname ){
1466+ print(a , quote = FALSE )
1467+ print(tbl_list [[a ]])
1468+ }
1469+ })
1470+
14491471output $ attrhist <- renderPlot({
14501472 nplots <- length(input $ attrcols )
14511473 if (nplots == 0 ){return ()}
@@ -1457,15 +1479,12 @@ output$attrhist <- renderPlot({
14571479 plot(density(nwdf()[[attrname ]]), main = attrname ,
14581480 col = " #076EC3" , lwd = 2 )
14591481 } else {
1460- if (attrname %in% numattr() & lvls > 9 ){
1461- tab <- hist.info(nwdf()[[attrname ]], breaks = 10 )
1462- } else {
1463- tab <- table(nwdf()[[attrname ]])
1464- }
1482+ tab <- attr.info(df = nwdf(), colname = attrname ,
1483+ numattrs = numattr(), breaks = 10 )
14651484 if (input $ attrhistaxis == " percent" ){
14661485 tab <- tab / sum(tab )
14671486 }
1468- barplot(tab , xlab = attrname , col = histblue )
1487+ barplot(tab , main = attrname , col = histblue )
14691488 }
14701489 } else {
14711490 r <- ceiling(nplots / 2 )
@@ -1475,15 +1494,12 @@ output$attrhist <- renderPlot({
14751494 if (input $ attrhistaxis == " density" & a %in% numattr() & lvls > 9 ){
14761495 plot(density(nwdf()[[a ]]), main = a , col = " #076EC3" , lwd = 2 )
14771496 } else {
1478- if (a %in% numattr() & lvls > 9 ){
1479- tab <- hist.info(nwdf()[[a ]], breaks = 10 )
1480- } else {
1481- tab <- table(nwdf()[[a ]])
1482- }
1483- if (input $ attrhistaxis == " percent" ){
1484- tab <- tab / sum(tab )
1485- }
1486- barplot(tab , xlab = a , col = histblue )
1497+ tab <- attr.info(df = nwdf(), colname = a ,
1498+ numattrs = numattr(), breaks = 10 )
1499+ if (input $ attrhistaxis == " percent" ){
1500+ tab <- tab / sum(tab )
1501+ }
1502+ barplot(tab , main = a , col = histblue )
14871503 }
14881504 }
14891505 }
@@ -2934,15 +2950,19 @@ output$listofterms <- renderUI({
29342950 choices = c(" Select a term" = " " , current.terms ))
29352951})
29362952
2937- output $ termdoc <- renderPrint ({
2953+ output $ termdoc <- renderUI ({
29382954 myterm <- input $ chooseterm
29392955 if (is.null(myterm )){
2940- return (cat(" Select or search for a term in the menu above." ))
2941- }
2942- if (myterm == " " ){
2943- return (cat(" Select or search for a term in the menu above." ))
2944- }
2945- search.ergmTerms(name = myterm )
2956+ return (p(" Select or search for a term in the menu above." ))
2957+ } else if (myterm == " " ){
2958+ return (p(" Select or search for a term in the menu above." ))
2959+ }
2960+ chrvec <- capture.output(search.ergmTerms(name = myterm ))
2961+ desc <- strsplit(chrvec [3 ], split = " _" )
2962+ p(chrvec [1 ], br(),br(),
2963+ strong(chrvec [2 ]), br(),br(),
2964+ em(desc [[1 ]][2 ]), desc [[1 ]][3 ], br(),
2965+ chrvec [4 ])
29462966})
29472967
29482968observe({
0 commit comments