Coder Social home page Coder Social logo

schochastics / graphlayouts Goto Github PK

View Code? Open in Web Editor NEW
265.0 265.0 16.0 20.24 MB

new layout algorithms for network visualizations in R

Home Page: https://schochastics.github.io/graphlayouts/

License: Other

R 69.59% C++ 28.19% TeX 2.23%
ggraph graph-algorithms network-analysis network-visualization r

graphlayouts's Introduction

Β Hi, I'm David! πŸ‘‹Β 



I am the Team Lead for "Transparent Social Anlytics" in the Department for Computational Social Science at GESIS

My main dev work is writing R packages and extensions for Quarto


Quarto

Academicons Shortcodes to use academicons with Quarto
Devicons Shortcodes to use devicons with Quarto
Blackboard revealjs theme A blackboard style theme for revealjs
Sketchy HTML theme A sketchy theme for HTML documents
Social Share Buttons Add social share buttons to HTML documents
Nutshell Include expandable explanations in documents
Quartocities Geocities template for Quarto websites
Glossary with nutshell Automatic glossary for websites using nutshell
CV templates CV/Resume templates for Quarto

graphlayouts's People

Contributors

arfon avatar gi0na avatar mbojan avatar schochastics avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

graphlayouts's Issues

Better error message for backbone layout

I get a rather uninformative error when I try to use the backbone layout with the 'meredith' graph. I cannot parse whether it is a bug in the layout code or if the graph type is somehow unsupported

ggraph(create_notable('meredith'), 'backbone') + 
geom_edge_link()
#>  Error in reweighting(el - 1, N_ranks) : Not a matrix. 

Backbone layout

I installed this package in R-3.6.3 and R-4.0.3. However, i always met this mistake when i run this code (Backbone layout):

bb <- layout_as_backbone(g, keep=0.4)

Error: oaqc is needed for this function to work. Please install it.

what should I do?? thank you

Return distance as part of focus layout output

Id' like to add the used distance in the focal layout as part of the ggraph layout. I could calculate it in ggraph, but that would basically be a repeat of one of the calculations in the layout algorithm. Could this measure be returned along with the coordinates by the algorithm?

README example error: oaqc needed

The example that begins with

bb <- layout_as_backbone(g,keep=0.4)

produces an error:

Error: oaqc is needed for this function to work. Please install it.

This isn't very clear. I assume that oaqc is a package, and available on CRAN? Is there a reason it's not listed in the package DESCRIPTION file under Suggests: or Imports:?

Noted as part of openjournals/joss-reviews#5238

Use tidy eval for node and edge parameters in layouts

The convention in the next ggraph release is that any argument to layouts that refer to some property of nodes or edges are using tidy evaluation. This has huge benefits as it means you don't need to modify the graph structure to change layout parameters.

Would it be possible to change the layout_tbl_graph_*() functions to follow this approach, or alternatively remove them and let me implement them directly in ggraph (then you wouldn't need to worry about the interface)

update vignette

probably gonna remove it and point to tutorial which is updated more frequently

DESCRIPTION text tweak

The last sentence in the Description: field is grammatically awkward:

Some more specific algorithms allow to emphasize hidden group structures in networks or focus on specific nodes.

Consider changing to "allow the user to".

Noted as part of openjournals/joss-reviews#5238

external packages

graphlayouts loads oaqc and gbp but only needs one function from each package. It might be good to implement these algorithms in graphlayouts to get rid of these dependencies

Can I steal qgraph?

I currently have nplot() in ggraph for similar, but more general, functionality. qgraph is a much better name though...

So a gentle request if we can come to an agreementπŸ™‚. If you don’t want to it is fine of course

UMST

The backbone layout requires the calculation of the union of maximum spanning trees. The implemented algorithm needs some refinements and testing

dynamic layouts example

The "dynamic layouts" example in the README begins

#gList is a list of longitudinal networks.

xy <- layout_as_dynamic(gList,alpha = 0.2)
pList <- vector("list",length(gList))

This is unclear; where does gList come from? Is there a way to make this example reproducible?

Noted as part of openjournals/joss-reviews#5238

layout_as_backbone crashes R

This crashes my R:

# remotes::install_github("mbojan/isnar")
library(igraph)
library(graphlayouts)
data(IBE121, package="isnar")
g <- IBE121 %>%
  delete_edges(E(.)[ question != "play"]) %>%
  delete_vertices(V(.)[8]) # Drop an isolate, but did not help
xy <- layout_as_backbone(g)   # (boom!)
─ Session info ───────────────────────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 3.6.0 (2019-04-26)
 os       Ubuntu 18.04.2 LTS          
 system   x86_64, linux-gnu           
 ui       RStudio                     
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       localtime                   
 date     2019-06-17                  

─ Packages ───────────────────────────────────────────────────────────────────────────────────
 package      * version date       lib source        
 assertthat     0.2.1   2019-03-21 [1] CRAN (R 3.6.0)
 cli            1.1.0   2019-03-19 [1] CRAN (R 3.6.0)
 crayon         1.3.4   2017-09-16 [1] CRAN (R 3.6.0)
 graphlayouts * 0.1.0   2019-04-05 [1] CRAN (R 3.6.0)
 igraph       * 1.2.4.1 2019-04-22 [1] CRAN (R 3.6.0)
 magrittr       1.5     2014-11-22 [1] CRAN (R 3.6.0)
 packrat        0.5.0   2018-11-14 [1] CRAN (R 3.6.0)
 pkgconfig      2.0.2   2018-08-16 [1] CRAN (R 3.6.0)
 Rcpp           1.0.1   2019-03-17 [1] CRAN (R 3.6.0)
 rstudioapi     0.10    2019-03-19 [1] CRAN (R 3.6.0)
 sessioninfo    1.1.1   2018-11-05 [1] CRAN (R 3.6.0)
 withr          2.1.2   2018-03-15 [1] CRAN (R 3.6.0)

[1] /home/mbojan/R/library/3.6
[2] /usr/local/lib/R/site-library
[3] /usr/lib/R/site-library
[4] /usr/lib/R/library

Struggling with stress (majorization)

See this igraph object saved as an RDS file and ZIPped x.rds.zip. I'm getting really strange results with stress_majorization():

library(igraph)
x <- readRDS("x.rds")

xysm <- smglr::stress_majorization(x)
xyfr <- igraph::layout_with_fr(x, grid="nogrid")

plot(x, layout=xysm, vertex.label=NA, vertex.size=3)
plot(x, layout=xyfr, vertex.label=NA, vertex.size=3)

The two plots are:

  1. stress majorization
    image

  2. fruchterman-reingold
    image

That does not seem right...

Better description of tseq argument

I'd like to have an understandable description of the tseq argument in the centrality layout. I've skimmed the article but couldn't quite extract the meaning - can you provide something clearer than transition steps? :-)

Compile fails on macOS 10.13.6

Here are the errors:

* installing *source* package β€˜graphlayouts’ ...
** package β€˜graphlayouts’ successfully unpacked and MD5 sums checked
** libs
clang++  -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/RcppArmadillo/include" -I/usr/local/include   -fPIC  -Wall -g -O2  -c RcppExports.cpp -o RcppExports.o
clang++  -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/RcppArmadillo/include" -I/usr/local/include   -fPIC  -Wall -g -O2  -c reweight.cpp -o reweight.o
clang++  -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/RcppArmadillo/include" -I/usr/local/include   -fPIC  -Wall -g -O2  -c sparseStress.cpp -o sparseStress.o
sparseStress.cpp:72:21: error: no type named 'const_col_iterator' in 'arma::SpMat<double>'; did you mean 'const_row_iterator'?
      arma::sp_mat::const_col_iterator start = A.begin_col(i);
      ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
                    const_row_iterator
/Library/Frameworks/R.framework/Versions/3.4/Resources/library/RcppArmadillo/include/armadillo_bits/SpMat_bones.hpp:448:9: note: 'const_row_iterator' declared here
  class const_row_iterator : public iterator_base
        ^
sparseStress.cpp:72:40: error: no viable conversion from 'arma::SpMat<double>::iterator' to 'arma::sp_mat::const_row_iterator'
      arma::sp_mat::const_col_iterator start = A.begin_col(i);
                                       ^       ~~~~~~~~~~~~~~
/Library/Frameworks/R.framework/Versions/3.4/Resources/library/RcppArmadillo/include/armadillo_bits/SpMat_bones.hpp:453:12: note: candidate constructor not viable: no known conversion from 'arma::SpMat<double>::iterator' to 'const arma::SpMat<double> &' for 1st argument
    inline const_row_iterator(const SpMat& in_M, uword initial_pos = 0);
           ^
/Library/Frameworks/R.framework/Versions/3.4/Resources/library/RcppArmadillo/include/armadillo_bits/SpMat_bones.hpp:456:12: note: candidate constructor not viable: no known conversion from 'arma::SpMat<double>::iterator' to 'const arma::SpMat<double>::const_row_iterator &' for 1st argument
    inline const_row_iterator(const const_row_iterator& other);
           ^
sparseStress.cpp:73:40: error: use of undeclared identifier 'end'; did you mean 'std::end'?
      arma::sp_mat::const_col_iterator end = A.end_col(i);
                                       ^~~
                                       std::end
/Library/Developer/CommandLineTools/usr/include/c++/v1/iterator:1650:1: note: 'std::end' declared here
end(_Tp (&__array)[_Np])
^
sparseStress.cpp:73:39: error: expected ';' after expression
      arma::sp_mat::const_col_iterator end = A.end_col(i);
                                      ^
                                      ;
sparseStress.cpp:73:21: error: no member named 'const_col_iterator' in 'arma::SpMat<double>'
      arma::sp_mat::const_col_iterator end = A.end_col(i);
      ~~~~~~~~~~~~~~^
sparseStress.cpp:73:48: error: assigning to '<overloaded function type>' from incompatible type 'arma::SpMat<double>::iterator'
      arma::sp_mat::const_col_iterator end = A.end_col(i);
                                             ~~^~~~~~~~~~
sparseStress.cpp:74:25: error: no type named 'const_col_iterator' in 'arma::SpMat<double>'; did you mean 'const_row_iterator'?
      for(arma::sp_mat::const_col_iterator k = start; k != end; ++k){
          ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
                        const_row_iterator
/Library/Frameworks/R.framework/Versions/3.4/Resources/library/RcppArmadillo/include/armadillo_bits/SpMat_bones.hpp:448:9: note: 'const_row_iterator' declared here
  class const_row_iterator : public iterator_base
        ^
sparseStress.cpp:74:60: error: use of undeclared identifier 'end'
      for(arma::sp_mat::const_col_iterator k = start; k != end; ++k){
                                                           ^
8 errors generated.
make: *** [sparseStress.o] Error 1
ERROR: compilation failed for package β€˜graphlayouts’
* removing β€˜/Library/Frameworks/R.framework/Versions/3.4/Resources/library/graphlayouts’
Warning in install.packages :
  installation of package β€˜graphlayouts’ had non-zero exit status

Using `set.seed()` in stress layout can catch the end user unawares

layout_with_stress() currently sets the RNG seed to 42 without warning the user, and I think this might have unwanted consequences for the end user.

As an example, I was recently perplexed because a code snippet of mine kept generating the same random numbers across runs, and I finally tracked it down to the fact that my snippet was calling a ggraph function which was itself calling layout_with_stress() (and thus resetting my RNG seed silently each time I ran my code snippet).

I understand that the fixed seed was introduced in commit 4d44c7f to make the stress layout reproducible, but it seems that modifying the RNG seed silently is quite risky for the unaware end user. One possible way to avoid this while keeping the stress layout reproducible would be to save the seed state at the beginning of layout_with_stress(), set the seed to 42 before calculating the layout and finally restore the saved seed upon exit.

If you think this would be a valid approach I'd be happy to prepare a pull request :)

Stress layout fails for disconnected graphs with an explicit weights vector

The stress majorisation layout doesn't seem to expect the graph to be disconnected when a weights vector is provided. Here's an example disconnected graph with 4 edges where a weights vector of 4 elements causes a length mismatch error:

g <- igraph::graph_from_literal(A-B-C-A, D-E)
igraph::ecount(g)
#> [1] 4
graphlayouts::layout_with_stress(g)
#>          [,1]      [,2]
#> [1,] 2.970066 0.2428427
#> [2,] 2.000000 0.0000000
#> [3,] 2.274725 0.9615229
#> [4,] 0.000000 0.0000000
#> [5,] 1.000000 0.0000000
graphlayouts::layout_with_stress(g, weights = c(1, 1, 1, 1))
#> Error in igraph::distances(sg, weights = weights): At core/paths/dijkstra.c:116 : Weight vector length does not match, Invalid value

Created on 2022-10-10 by the reprex package (v2.0.1)

The layout implementation contains a loop over connected components of the graph. For each component, an induced subgraph sg is created. It then calls igraph::distances() with the subgraph, but provides the full weights vector of the original graph:

D <- igraph::distances(sg,weights = weights)

If I'm understanding this correctly, the weights passed here should be a subset of the weights vector with elements corresponding only to the vertices retained in the subgraph for that component.

Error if graph has isolates

stress_majorization(make_graph(~ a -- b, c))
# Error in igraph::layout_with_mds(sg) : 
#   At layout.c:2095 : dim must be less than the number of nodes, Invalid value

I fixed that on my fork already. Do you want a PR?

Testthat tests

While fixing #3 I implemented some rudimentary tests using testthat package. Would like them?

Speaking of which, I can also submit TravisCI and Appveyor setup files so that R CMD check is automatically run after every commit. Interested?

Prevent Node and Edge Overlaps for Radial Layout with Focal Node

Hi,

I am trying to plot a Radial Layout with Focal Node with my data that contains ~3000 Nodes. How do I make sure that none of the nodes and edges overlap and are spaced out clearly even if I increase the node size. I was wondering if the radii of the concentric circles could be controlled in order to prevent overlapping of nodes, but I am also looking have non-overlapping edges.

Below id my code and attached is the .RData:

layout<-layout_with_focus(df.g,v = 1383)
max(distances(df.g,1383))

ggraph(df.g,layout = "focus",focus = 1383)+
draw_circle(use = "focus", max.circle = max(distances(df.g,1383)))+
geom_edge_link()+
geom_node_point(shape = 21,fill = "grey25",size = 1)+
theme_graph()+
coord_fixed()

graph_rdata.zip

layout_as_backbone - returns data with one node less

I have run
bb <- layout_as_backbone(g, keep = 0.4)
and got bb$xy where one node is missing but I can understand which one and what to do with my data to solve the issue.
Seems this node lost in umst <- function(g).
There is nothing about this issue in ??layout_as_backbone, is it possible to identify the node lost?

Thank you in advance!

backbone layout issues

The backbone layout algorithm does not work properly yet. Most likely there is an issue with the proper edge weighting

layout_as_backbone --> crash!

GrΓΌezi David! I was so excited to finally be able to use a backbone layout in R directly (and not via the visone GUI). But when I want to use it for one particular network R crashes.

you can download the example data here: https://polybox.ethz.ch/index.php/s/v8nv7jbMpGfhbUs

rm(list = ls())
library(igraph)
library(ggraph)
library(graphlayouts)

set.seed(23)
know.g <- erdos.renyi.game(80, p.or.m = 0.005379747) 
bb <- layout_as_backbone
(know.g) # works fine

load("know_for_david.RData")
know.g <- graph.adjacency(know)
bb <- layout_as_backbone(know.g) # crash!

Peace!

README picture and some questions

The example picture with igraph defaults looks really exotic. The reason is that it is based on FR layout computed using a grid-based implementation (faster but less "accurate") which unfortunately is broken. Igraph uses classic FR unless the network has 1000 nodes or more, then it is grid-based FR. You have just passed the red line in your example :)

I also have some questions (commented on Discuss, but perhaps this is a better place):

  1. Do you plan to implement the weights?
  2. Is it possible to have constraints on node positioning in this layout? E.g. constrain node(s) to be in a specified box. Much like minx, maxx, etc. arguments to igraph::layout_with_fr().

Thanks!

Resource allocation and tuning

Hi, I am running this package in an HPC. Particularly, the layout_as_backbone function. I can allocate as many as five nodes, with 20 processors and 12GB for each processor.

Could you give me a better sense of whether it is possible to allocate such resources so that the layout is computed faster? I guess there is no way to run a multi-node application but how about multiple cores? Or is the best way just to allocate a lot of RAM to a single core?

Thanks in advance for your guidance!

Error in sparseStress

Error using layout_with_sparse_stress() for network with >150k nodes

Error in sparseStress(y, D, RpL, pivs, A, iter) : 
  SpMat::init(): requested size is too large; suggest to enable ARMA_64BIT_WORD

Allow specifying start position of nodes

While not being fully clear on the underlying algorithms, most layout algorithms sample some start position of the nodes and then iterate on that. In igraph it is possible to provide the start position and it only sample if none is given. Will this be possible for the layouts herein as well?

ggplot2 warning when running README example

Running the first example in the README produces a warning from ggplot2:

> ggraph(pa,layout = "nicely")+
+     geom_edge_link0(width=0.2,colour="grey")+
+     geom_node_point(col="black",size=0.3)+
+     theme_graph()
Warning message:
Using the `size` aesthetic in this geom was deprecated in ggplot2 3.4.0.
β„Ή Please use `linewidth` in the `default_aes` field and elsewhere instead.
This warning is displayed once every 8 hours.
Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
generated. 

Noted as part of openjournals/joss-reviews#5238

Compilation fails on MacOS 11.2

Compilation fails for me, installing from CRAN and GitHub.

CRAN error logs:

Installing package into β€˜/usr/local/lib/R/4.0/site-library’
(as β€˜lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/graphlayouts_0.7.1.tar.gz'
Content type 'application/x-gzip' length 2410184 bytes (2.3 MB)
==================================================
downloaded 2.3 MB

* installing *source* package β€˜graphlayouts’ ...
** package β€˜graphlayouts’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
clang++ -I"/usr/local/Cellar/r/4.0.3_2/lib/R/include" -DNDEBUG  -I'/usr/local/lib/R/4.0/site-library/Rcpp/include' -I'/usr/local/lib/R/4.0/site-library/RcppArmadillo/include' -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include   -fPIC  -g -O2  -c RcppExports.cpp -o RcppExports.o
In file included from RcppExports.cpp:4:
In file included from /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/RcppArmadillo.h:31:
In file included from /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/RcppArmadilloForward.h:49:
In file included from /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo:21:
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/compiler_check.hpp:50:4: error: "*** C++11 compiler required; enable C++11 mode in your compiler, or use an earlier version of Armadillo"
  #error "*** C++11 compiler required; enable C++11 mode in your compiler, or use an earlier version of Armadillo"
   ^
In file included from RcppExports.cpp:4:
In file included from /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/RcppArmadillo.h:31:
In file included from /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/RcppArmadilloForward.h:49:
In file included from /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo:85:
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:149:12: error: unknown type name 'constexpr'
    static constexpr bool is_row  = false;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:150:12: error: unknown type name 'constexpr'
    static constexpr bool is_col  = false;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:151:12: error: unknown type name 'constexpr'
    static constexpr bool is_xvec = false;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:161:12: error: unknown type name 'constexpr'
    static constexpr bool is_row  = false;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:162:12: error: unknown type name 'constexpr'
    static constexpr bool is_col  = false;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:163:12: error: unknown type name 'constexpr'
    static constexpr bool is_xvec = true;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:173:12: error: unknown type name 'constexpr'
    static constexpr bool is_row  = false;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:174:12: error: unknown type name 'constexpr'
    static constexpr bool is_col  = true;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:175:12: error: unknown type name 'constexpr'
    static constexpr bool is_xvec = false;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:185:12: error: unknown type name 'constexpr'
    static constexpr bool is_row  = true;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:186:12: error: unknown type name 'constexpr'
    static constexpr bool is_col  = false;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:187:12: error: unknown type name 'constexpr'
    static constexpr bool is_xvec = false;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:197:12: error: unknown type name 'constexpr'
    static constexpr bool is_row  = T1::is_row;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:198:12: error: unknown type name 'constexpr'
    static constexpr bool is_col  = T1::is_col;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:199:12: error: unknown type name 'constexpr'
    static constexpr bool is_xvec = T1::is_xvec;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:209:12: error: unknown type name 'constexpr'
    static constexpr bool is_row  = false;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:210:12: error: unknown type name 'constexpr'
    static constexpr bool is_col  = false;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:211:12: error: unknown type name 'constexpr'
    static constexpr bool is_xvec = false;
           ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [RcppExports.o] Error 1
ERROR: compilation failed for package β€˜graphlayouts’
* removing β€˜/usr/local/lib/R/4.0/site-library/graphlayouts’
Warning in install.packages :
  installation of package β€˜graphlayouts’ had non-zero exit status

The downloaded source packages are in
	β€˜/private/var/folders/9h/4jxmf82d5191ch21bc8_tbc00000gn/T/RtmpKEURJe/downloaded_packages’

GitHub error logs:

> remotes::install_github("schochastics/graphlayouts")
Downloading GitHub repo schochastics/graphlayouts@HEAD
βœ“  checking for file β€˜/private/var/folders/9h/4jxmf82d5191ch21bc8_tbc00000gn/T/RtmpCQWdU4/remotes41d461458bc/schochastics-graphlayouts-81c700e/DESCRIPTION’ ...
─  preparing β€˜graphlayouts’:
βœ“  checking DESCRIPTION meta-information ...
─  cleaning src
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building β€˜graphlayouts_0.7.1.tar.gz’
   
Installing package into β€˜/usr/local/lib/R/4.0/site-library’
(as β€˜lib’ is unspecified)
* installing *source* package β€˜graphlayouts’ ...
** using staged installation
** libs
clang++ -I"/usr/local/Cellar/r/4.0.3_2/lib/R/include" -DNDEBUG  -I'/usr/local/lib/R/4.0/site-library/Rcpp/include' -I'/usr/local/lib/R/4.0/site-library/RcppArmadillo/include' -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include   -fPIC  -g -O2  -c RcppExports.cpp -o RcppExports.o
In file included from RcppExports.cpp:4:
In file included from /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/RcppArmadillo.h:31:
In file included from /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/RcppArmadilloForward.h:49:
In file included from /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo:21:
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/compiler_check.hpp:50:4: error: "*** C++11 compiler required; enable C++11 mode in your compiler, or use an earlier version of Armadillo"
  #error "*** C++11 compiler required; enable C++11 mode in your compiler, or use an earlier version of Armadillo"
   ^
In file included from RcppExports.cpp:4:
In file included from /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/RcppArmadillo.h:31:
In file included from /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/RcppArmadilloForward.h:49:
In file included from /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo:85:
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:149:12: error: unknown type name 'constexpr'
    static constexpr bool is_row  = false;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:150:12: error: unknown type name 'constexpr'
    static constexpr bool is_col  = false;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:151:12: error: unknown type name 'constexpr'
    static constexpr bool is_xvec = false;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:161:12: error: unknown type name 'constexpr'
    static constexpr bool is_row  = false;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:162:12: error: unknown type name 'constexpr'
    static constexpr bool is_col  = false;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:163:12: error: unknown type name 'constexpr'
    static constexpr bool is_xvec = true;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:173:12: error: unknown type name 'constexpr'
    static constexpr bool is_row  = false;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:174:12: error: unknown type name 'constexpr'
    static constexpr bool is_col  = true;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:175:12: error: unknown type name 'constexpr'
    static constexpr bool is_xvec = false;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:185:12: error: unknown type name 'constexpr'
    static constexpr bool is_row  = true;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:186:12: error: unknown type name 'constexpr'
    static constexpr bool is_col  = false;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:187:12: error: unknown type name 'constexpr'
    static constexpr bool is_xvec = false;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:197:12: error: unknown type name 'constexpr'
    static constexpr bool is_row  = T1::is_row;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:198:12: error: unknown type name 'constexpr'
    static constexpr bool is_col  = T1::is_col;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:199:12: error: unknown type name 'constexpr'
    static constexpr bool is_xvec = T1::is_xvec;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:209:12: error: unknown type name 'constexpr'
    static constexpr bool is_row  = false;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:210:12: error: unknown type name 'constexpr'
    static constexpr bool is_col  = false;
           ^
/usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:211:12: error: unknown type name 'constexpr'
    static constexpr bool is_xvec = false;
           ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [RcppExports.o] Error 1
ERROR: compilation failed for package β€˜graphlayouts’
* removing β€˜/usr/local/lib/R/4.0/site-library/graphlayouts’
Error: Failed to install 'graphlayouts' from GitHub:
  (converted from warning) installation of package β€˜/var/folders/9h/4jxmf82d5191ch21bc8_tbc00000gn/T//RtmpCQWdU4/file41d363559a2/graphlayouts_0.7.1.tar.gz’ had non-zero exit status

Session info:

> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin20.2.0 (64-bit)
Running under: macOS Big Sur 10.16

Matrix products: default
LAPACK: /usr/local/Cellar/r/4.0.3_2/lib/R/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.6         magrittr_2.0.1     units_0.6-7        maptools_1.0-2     tigris_1.0         rappdirs_0.3.3    
 [7] uuid_0.1-4         tidyselect_1.1.0   lattice_0.20-41    R6_2.5.0           rlang_0.4.10       stringr_1.4.0     
[13] httr_1.4.2         parzer_0.3.0       dplyr_1.0.4        tools_4.0.3        rgdal_1.5-23       grid_4.0.3        
[19] KernSmooth_2.23-18 e1071_1.7-4        DBI_1.1.1          class_7.3-18       ellipsis_0.3.1     assertthat_0.2.1  
[25] tibble_3.0.6       lifecycle_0.2.0    sf_0.9-7           crayon_1.4.0       purrr_0.3.4        vctrs_0.3.6       
[31] glue_1.4.2         sp_1.4-5           stringi_1.5.3      compiler_4.0.3     pillar_1.4.7       generics_0.1.0    
[37] classInt_0.4-3     foreign_0.8-81     pkgconfig_2.0.3   

layout_as_backbone says boom

I'm getting a crash when running the following code

library(igraph)
bi <- structure(list(term1 = c("classification", "regression", "model", 
                               "learn", "model", "descent", "linear", "dimensional", "mining", 
                               "network", "selection", "algorithm", "base", "forests", "forest", 
                               "algorithm", "package", "framework", "classification", "algorithm", 
                               "algorithm", "framework", "bayesian", "model", "analysis", "include", 
                               "data", "random", "implementation", "selection", "data", "data", 
                               "algorithm", "algorithm", "gradient", "data", "framework", "model", 
                               "cognitive", "cognitive", "microsoft", "high", "algorithm", "include", 
                               "fit", "interface", "partial", "log", "linear", "feed", "linear", 
                               "frequency", "allocation", "rest", "random", "forest", "base", 
                               "classification", "content", "corpora", "linear", "match", "data", 
                               "distribution", "distribution", "topic", "allocation", "language", 
                               "content", "file", "article", "convex", "fit", "group", "group", 
                               "author", "source", "function", "function", "function", "distance", 
                               "analysis", "model", "service", "article", "graph", "function", 
                               "data", "data", "data"), term2 = c("regression", "tree", "topic", 
                                                                  "machine", "regression", "gradient", "model", "high", "text", 
                                                                  "neural", "variable", "base", "model", "random", "random", "learn", 
                                                                  "provide", "text", "tree", "use", "descent", "mining", "tree", 
                                                                  "use", "data", "model", "use", "use", "random", "use", "dimensional", 
                                                                  "high", "machine", "gradient", "stochastic", "set", "provide", 
                                                                  "multinomial", "microsoft", "service", "service", "model", "method", 
                                                                  "method", "model", "package", "plot", "multinomial", "log", "neural", 
                                                                  "multinomial", "word", "latent", "service", "tree", "implementation", 
                                                                  "distance", "learn", "text", "source", "path", "string", "frequency", 
                                                                  "frequency", "word", "topic", "model", "model", "file", "text", 
                                                                  "corpora", "convex", "path", "lasso", "method", "title", "title", 
                                                                  "sparse", "version", "string", "string", "include", "word", "text", 
                                                                  "lexisnexis", "represent", "object", "data", "graph", "represent"
                               ), best_topic = c("10", "10", "12", "6", "10", "3", "1", "7", 
                                                 "13", "11", "7", "1", "10", "8", "8", "3", "13", "13", "10", 
                                                 "3", "3", "13", "10", "1", "1", "1", "1", "8", "8", "7", "7", 
                                                 "7", "6", "3", "3", "14", "13", "11", "9", "9", "9", "7", "6", 
                                                 "6", "4", "13", "12", "11", "11", "11", "11", "14", "12", "9", 
                                                 "8", "8", "6", "6", "5", "5", "4", "15", "14", "14", "14", "12", 
                                                 "12", "9", "5", "5", "5", "4", "4", "4", "4", "2", "2", "15", 
                                                 "15", "15", "15", "14", "12", "9", "5", "2", "15", "2", "2", 
                                                 "2"), cooc = c(38L, 27L, 22L, 21L, 19L, 18L, 18L, 17L, 15L, 15L, 
                                                                14L, 14L, 13L, 12L, 12L, 11L, 11L, 11L, 11L, 9L, 9L, 9L, 9L, 
                                                                9L, 8L, 8L, 8L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 6L, 
                                                                6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 5L, 5L, 4L, 4L, 
                                                                4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 3L, 3L, 3L, 3L, 
                                                                3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 2L, 2L, 2L, 2L, 
                                                                1L, 1L, 1L), select = c(1L, 2L, 1L, 1L, 3L, 1L, 1L, 1L, 1L, 1L, 
                                                                                        2L, 2L, 4L, 1L, 2L, 2L, 2L, 3L, 5L, 3L, 4L, 4L, 6L, 3L, 4L, 5L, 
                                                                                        6L, 3L, 4L, 3L, 4L, 5L, 2L, 5L, 6L, 1L, 5L, 2L, 1L, 2L, 3L, 6L, 
                                                                                        3L, 4L, 1L, 6L, 2L, 3L, 4L, 5L, 6L, 2L, 3L, 4L, 5L, 6L, 5L, 6L, 
                                                                                        1L, 2L, 2L, 1L, 3L, 4L, 5L, 4L, 5L, 5L, 3L, 4L, 5L, 3L, 4L, 5L, 
                                                                                        6L, 1L, 2L, 2L, 3L, 4L, 5L, 6L, 6L, 6L, 6L, 3L, 6L, 4L, 5L, 6L
                                                                )), row.names = c(NA, -90L), class = "data.frame")
g <- graph_from_data_frame(bi, directed = FALSE)

library(graphlayouts)
library(oaqc)
bb <- layout_as_backbone(g)

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.