Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
martinamorris opened this issue Jul 24, 2020 · 3 comments
Open
Assignees

Comments

@martinamorris
Copy link
Member

can be reproduced with the attached file
NursingHomeMatrix.zip

@martinamorris
Copy link
Member Author

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]

@netterie
Copy link

netterie commented Jul 29, 2020

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants