Closed maelle closed 6 months ago
Maybe due to some randomness?
Yes.
There's no guarantee that randomly picked integers will form a graphical degree sequence (i.e. that there's a graph with these degrees).
should we set the seed for this example then?
yes
I also wondering what is the issue in github actions and should we install something to docker image to make it work?
Error in .External2(C_X11, d$display, d$width, d$height, d$pointsize, :
unable to start device X11cairo
Calls: source -> withVisible -> eval -> eval -> eval -> eval -> x11
In addition: Warning message:
In x11(width = 10, height = 5) :
unable to open connection to X11 display ''
let me try finding a seed that works
this might require making the example dependent on installing withr, or adding more boiler plate to preserve the seed.
another thing I want to fix is the use of the same name for two variables in the same examples (degs)
this might require making the example dependent on installing withr, or adding more boiler plate to preserve the seed.
Alternatively, you can keep generating degree sequences until is_graphical
returns true. We can make it so that the probability of getting a good sequence is high (but it's next to impossible to make it guaranteed).
I'm not sure if R has a one-liner for this? In the Mathematica interface of igraph I even have a helper function for rejection sampling, i.e. for trying and retrying until a condition is satisfied.
@Antonov548 is your issue a distinct issue?
I feel the example would be simpler to read if we simply preserved the seed.
I feel the example would be simpler to read if we simply preserved the seed.
I think so. It's more related to the fact there is quite a lot of examples which draws a charts. I don't have much expertise in it, but on GitHub actions there is not UI and I guess it's failing to create window with chart.
Ok, let's tackle this in #1300
Related to #1286 (@Antonov548) I extracted all examples in an Rmd file to knit it and see what fails.
I get
for
but running this code directly, or with reprex... does NOT lead to any error. Maybe due to some randomness?