statnetWeb icon indicating copy to clipboard operation
statnetWeb copied to clipboard

network plot crashes app on hover if there are no nodal attributes

Open martinamorris opened this issue 4 years ago • 3 comments

can be reproduced with the attached file NursingHomeMatrix.zip

martinamorris avatar Jul 24 '20 23:07 martinamorris

error trace:

Warning in if (is.edgelist.sna(z)) { :
  the condition has length > 1 and only the first element will be used
Error in if (is.edgelist.sna(z)) { : 
  argument is not interpretable as logical
Warning in if (is.edgelist.sna(z)) { :
  the condition has length > 1 and only the first element will be used
Error in if (is.edgelist.sna(z)) { : 
  argument is not interpretable as logical
Warning: Error in if: missing value where TRUE/FALSE needed
  94: [[<-.data.frame
  92: <reactive:nwdf> [C:\Users\Martina Morris\Documents\R\win-library\4.0\statnetWeb\shiny\statnetWeb/server.R#534]
  76: nwdf
  73: observeEventHandler [C:\Users\Martina Morris\Documents\R\win-library\4.0\statnetWeb\shiny\statnetWeb/server.R#1426]
   2: shiny::runApp
   1: run_sw [C:/Users/Martina Morris/Documents/Github/StatnetOrganization/statnetWeb/R/run_sw.R#16]

martinamorris avatar Jul 24 '20 23:07 martinamorris

Progress 7/28/20: I can almost replicate the error in creating nwdf (server.R#534) with the nursing home data, but not quite.

Using the following code to read in the network data (pulled from _server.R#141),

try({nursing <- network(read.csv('NursingHomeMatrix.csv', sep=",", header=FALSE,
                                row.names=NULL),
#                  directed=input$dir, loops=input$loops,
#                  multiple=input$multiple, bipartite=input$bipartite,
#                  matrix.type=input$matrixtype,
                  ignore.eval=FALSE, names.eval='edgevalue')
     })

stepping through subsequent code gives me the following for nwdf instead of throwing an error: image

The way I've read in the data assigns one attribute called "vertex.names", instead of no attributes.

JEANETTE START HERE Investigate the options of the network() command. The defaults the Shiny app sets must be different than the defaults of the network() command or different from header=TRUE or row.names=NULL for read.csv().

netterie avatar Jul 29 '20 00:07 netterie

No that can't be it - when you upload the network, the app does show "vertex.names" as an attribute.

image

I'll turn off extraneous elements of the UI and add some extra textOutput to see what if I'm replicating nwdf incorrectly.

netterie avatar Jul 31 '20 03:07 netterie