@@ -141,7 +141,7 @@ assign('input_termslist', list(),
141141# '
142142# ' Notice that already in this chunk of code we call previously declared reactive
143143# ' objects. For example, to use the reactive list of vertex attributes in the
144- # ' definition of the numeric vertex attributes, we call `attr ()`.
144+ # ' definition of the numeric vertex attributes, we call `attrib ()`.
145145# + eval=FALSE
146146
147147# move to Data panel when user clicks Get Started button
@@ -563,7 +563,7 @@ nwattrinit <- reactive({
563563})
564564
565565# list of all vertex attributes in nw (after adding new)
566- attr <- reactive({
566+ attrib <- reactive({
567567 attr <- c()
568568 if (is.network(nw())){
569569 attr <- list.vertex.attributes(nw())
@@ -573,7 +573,7 @@ attr <- reactive({
573573
574574# don't allow "na" or "vertex.names" as vertex attributes in menus on fit tab
575575menuattr <- reactive({
576- menuattr <- attr ()
576+ menuattr <- attrib ()
577577 if (is.element(" na" ,menuattr )){
578578 menuattr <- menuattr [- which(" na" == menuattr )]
579579 }
@@ -587,9 +587,9 @@ menuattr <- reactive({
587587numattr <- reactive({
588588 numattr <- c()
589589 if (is.network(nw())){
590- for (i in 1 : length(attr ())){
591- if (is.numeric(get.vertex.attribute(nw(),attr ()[i ]))){
592- numattr <- append(numattr ,attr ()[i ])
590+ for (i in 1 : length(attrib ())){
591+ if (is.numeric(get.vertex.attribute(nw(),attrib ()[i ]))){
592+ numattr <- append(numattr ,attrib ()[i ])
593593 }
594594 }}
595595 numattr })
@@ -964,7 +964,7 @@ output$attr2 <- renderPrint({
964964output $ dynamiccolor <- renderUI({
965965 selectInput(' colorby' ,
966966 label = ' Color nodes according to:' ,
967- c(' None' = 2 , attr ()),
967+ c(' None' = 2 , attrib ()),
968968 selectize = FALSE )
969969})
970970outputOptions(output ,' dynamiccolor' ,suspendWhenHidden = FALSE , priority = 10 )
@@ -2438,21 +2438,54 @@ output$currentdataset4 <- renderPrint({
24382438})
24392439
24402440
2441- output $ sim.summary <- renderPrint({
2441+ output $ simsummary <- renderPrint({
24422442 if (input $ simButton == 0 ){
24432443 return (cat(' ' ))
24442444 }
2445- model1sim <- isolate(model1simreac())
2446- if (isolate(input $ nsims ) == 1 ){
2447- return (model1sim )
2445+ sim <- isolate(model1simreac())
2446+ n <- isolate(input $ nsims )
2447+ sum <- list ()
2448+ sum [1 ] <- " \n "
2449+ sum [2 ] <- paste(" Number of Networks: " ,n , " \n " )
2450+ sum [3 ] <- paste(" Model: " , nwname(),' ~ ' ,ergm.terms(), " \n " )
2451+ sum [4 ] <- paste(" Reference: " , format(attr(sim ,' reference' )), " \n " )
2452+ sum [5 ] <- paste(" Constraints: " , format(attr(sim , ' constraints' )), " \n " )
2453+ sum [6 ] <- paste(" Parameters: \n " )
2454+ cat(unlist(sum ))
2455+ })
2456+
2457+ output $ simcoef <- renderPrint({
2458+ if (input $ simButton == 0 ){
2459+ return (cat(' ' ))
2460+ }
2461+ sim <- isolate(model1simreac())
2462+ c <- attr(sim , ' coef' )
2463+ c <- cbind(format(names(c )),c )
2464+ write.table(c , quote = FALSE , row.names = FALSE , col.names = FALSE )
2465+ })
2466+
2467+ output $ simstats <- renderPrint({
2468+ if (input $ simButton == 0 ){
2469+ return (cat(' ' ))
2470+ }
2471+ sim <- isolate(model1simreac())
2472+ m <- format(t(attr(sim ,' stats' )))
2473+ m <- cbind(format(rownames(m )),m )
2474+ write.table(m , quote = F , row.names = F , col.names = F )
2475+ })
2476+
2477+ output $ simsummary2 <- renderPrint({
2478+ if (input $ simButton == 0 ){
2479+ return (cat(' ' ))
24482480 }
2449- return (summary(model1sim ))
2481+ sim <- isolate(model1simreac())
2482+ sim
24502483})
24512484
24522485output $ dynamiccolor2 <- renderUI({
24532486 selectInput(' colorby2' ,
24542487 label = ' Color nodes according to:' ,
2455- c(' None' = 2 , attr ()),
2488+ c(' None' = 2 , attrib ()),
24562489 selected = 2 ,
24572490 selectize = FALSE )
24582491})
0 commit comments