Giter Site home page Giter Site logo

revdeps about rigraph HOT 13 OPEN

maelle avatar maelle commented on August 23, 2024
revdeps

from rigraph.

Comments (13)

maelle avatar maelle commented on August 23, 2024

thomasp85/tidygraph#198

from rigraph.

maelle avatar maelle commented on August 23, 2024

thomasp85/tidygraph#199

I get no failure for tidygraph with the current igraph version @krlmlr

from rigraph.

maelle avatar maelle commented on August 23, 2024

ropensci/skynet#11

from rigraph.

maelle avatar maelle commented on August 23, 2024

osofr/simcausal#22

from rigraph.

maelle avatar maelle commented on August 23, 2024

rcmfs also uses from() instead of .from() but I could not locate the package source so we'll have to email the maintainer.

from rigraph.

maelle avatar maelle commented on August 23, 2024

netropy error.

Error in igraph::distances(g) : 
  At vendor/cigraph/src/paths/dijkstra.c:128 : Weights must not contain NaN values. Invalid value
Backtrace:
  1. netropy::assoc_graph(df.att.ed, 0.15)
  2. ggraph::ggraph(ag, layout = "stress")
       at netropy/R/assoc_graph.R:45:3
  5. ggraph:::create_layout.default(graph, layout, ...)
  7. ggraph:::create_layout.tbl_graph(graph, layout, ...)
  9. ggraph:::layout_to_table.character(...)
 10. ggraph (local) layout_fun(graph, circular = circular, ...)
 11. graphlayouts::layout_with_stress(...)
 12. graphlayouts:::.layout_with_stress_dim(...)
 13. igraph::distances(g)

from rigraph.

maelle avatar maelle commented on August 23, 2024

in netropy

structure(list(7, FALSE, c(1, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 3, 
4, 5, 6, 4, 5, 6, 5, 6, 6), c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 
2, 2, 2, 2, 3, 3, 3, 4, 4, 5), NULL, NULL, NULL, NULL, list(c(1, 
0, 1), structure(list(), names = character(0)), list(name = c("status", 
"gender", "office", "years", "age", "practice", "lawschool")), 
    list(weight = c(NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, 
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, 
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, 
    NA_real_, NA_real_, NA_real_, NA_real_))), <environment>), class = "igraph")
Error in igraph::distances(g) : 
  At vendor/cigraph/src/paths/dijkstra.c:128 : Weights must not contain NaN values. Invalid value
Backtrace:
  1. netropy::assoc_graph(df.att.ed, 0.15)
  2. ggraph::ggraph(ag, layout = "stress")
       at netropy/R/assoc_graph.R:45:3
  5. ggraph:::create_layout.default(graph, layout, ...)
  7. ggraph:::create_layout.tbl_graph(graph, layout, ...)
  9. ggraph:::layout_to_table.character(...)
 10. ggraph (local) layout_fun(graph, circular = circular, ...)
 11. graphlayouts::layout_with_stress(...)
 12. graphlayouts:::.layout_with_stress_dim(...)
 13. igraph::distances(g)

The error is somewhere in ggraph/graphlayouts. I don't understand when we changed what distances() accepts as input. Or did we change graph_from_adjacency_matrix() somehow? It's that call that creates the NA weights.

from rigraph.

maelle avatar maelle commented on August 23, 2024

Reg BCT, I do not know where the package source is. I think #1431 will fix the problem on our side.

I however note that BCT should update its usage of igraph:

https://github.com/cran/BCT/blob/23e22470683b417c6da33cd3c55ab2c29d8670cf/R/process_bct.R#L46

should use make_lattice(), for instance.

from rigraph.

maelle avatar maelle commented on August 23, 2024

https://github.com/termehs/netropy

library(netropy)
df.att <- lawdata[[4]]

df.att.ed <- data.frame(
  status = df.att$status,
  gender = df.att$gender,
  office = df.att$office - 1,
  years = ifelse(df.att$years <= 3, 0,
    ifelse(df.att$years <= 13, 1, 2)
  ),
  age = ifelse(df.att$age <= 35, 0,
    ifelse(df.att$age <= 45, 1, 2)
  ),
  practice = df.att$practice,
  lawschool = df.att$lawschool - 1
)

assoc_graph(df.att.ed, 0.15)
#> Error in igraph::distances(g): At vendor/cigraph/src/paths/dijkstra.c:128 : Weights must not contain NaN values. Invalid value

Created on 2024-07-18 with reprex v2.1.0

from rigraph.

krlmlr avatar krlmlr commented on August 23, 2024

BCT still shows failures, unfortunately.

from rigraph.

maelle avatar maelle commented on August 23, 2024

Reg BCT

s <- c("2", "11", "00", "10", "12", "011", "020", "021", "012", "022", 
"0100", "0102", "0101") 
init_g=igraph::graph.empty(n=1)
#> Warning: `graph.empty()` was deprecated in igraph 2.0.4.
#> ℹ Please use `make_empty_graph()` instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
  igraph::V(init_g)$name=""
   g = init_g
     for(word in c(s)){
    # turns "10100" into c("1","10","101","1010", 10100")
    subwords = stringr::str_sub(word, 1, 1:nchar(word))
    # make a graph long enough to hold all those sub-words + start node
    subg = igraph::graph.lattice(length(subwords)+1,directed=TRUE)
    # set vertex nodes to start node plus sub-words
    igraph::V(subg)$name=c("",subwords)
    # merge *by name* into the existing graph
    g = igraph::graph.union(g, subg)
  }
#> Warning: `graph.lattice()` was deprecated in igraph 2.0.4.
#> ℹ Please use `make_lattice()` instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
#> Warning: `graph.union()` was deprecated in igraph 2.0.0.
#> ℹ Please use `union.igraph()` instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
#> Error in getval(w, name): argument "newval" is missing, with no default

Created on 2024-07-19 with reprex v2.1.0

Backtrace:
 1. igraph::graph.union(g, subg)
 2. igraph:::union.igraph(byname = byname, ...)
      at rigraph/R/operators.R:29:3
 3. igraph:::.igraph.graph.union.or.intersection(...)
      at rigraph/R/operators.R:448:3
 4. igraph:::rename.attr.if.needed("g", newgraphs)
      at rigraph/R/operators.R:320:5
 5. igraph (local) getval(w, name)
      at rigraph/R/operators.R:151:7

from rigraph.

maelle avatar maelle commented on August 23, 2024

Replacing graph.lattice() with make_lattice() makes the error disappear!

s <- c("2", "11", "00", "10", "12", "011", "020", "021", "012", "022", 
"0100", "0102", "0101") 
init_g=igraph::graph.empty(n=1)
#> Warning: `graph.empty()` was deprecated in igraph 2.0.4.
#> ℹ Please use `make_empty_graph()` instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
  igraph::V(init_g)$name=""
   g = init_g
     for(word in c(s)){
    # turns "10100" into c("1","10","101","1010", 10100")
    subwords = stringr::str_sub(word, 1, 1:nchar(word))
    # make a graph long enough to hold all those sub-words + start node
    subg = igraph::make_lattice(length(subwords)+1,directed=TRUE)
    # set vertex nodes to start node plus sub-words
    igraph::V(subg)$name=c("",subwords)
    # merge *by name* into the existing graph
    g = igraph::graph.union(g, subg)
  }
#> Warning: `graph.union()` was deprecated in igraph 2.0.0.
#> ℹ Please use `union.igraph()` instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.

Created on 2024-07-19 with reprex v2.1.0

from rigraph.

maelle avatar maelle commented on August 23, 2024

so the remaining mystery is netropy I suppose

from rigraph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.