### Build and Install R Source: https://github.com/igraph/rigraph/wiki/Testing-with-sanitizers Build R using the 'make' command, optionally setting parallel job flags for faster builds. Install R to the configured prefix using 'make install'. ```bash export MAKEFLAGS=-j8 make make install ``` -------------------------------- ### Install Library Targets Source: https://github.com/igraph/rigraph/blob/main/src/vendor/cigraph/src/CMakeLists.txt Installs the main library targets, including executables and libraries, to their designated installation directories. ```cmake install( TARGETS igraph bliss cliquer cxsparse_vendored pcg prpack EXPORT igraph_targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) ``` -------------------------------- ### Run R Script Example Source: https://github.com/igraph/rigraph/blob/main/revdep/examples/README.md Demonstrates how to run a reverse dependency example script using Rscript. ```bash Rscript revdep/examples/tidygraph-bfs-father-issue.R ``` -------------------------------- ### Install Header Files from Source Directory Source: https://github.com/igraph/rigraph/blob/main/src/vendor/cigraph/src/CMakeLists.txt Installs header files from the project's source directory to the installation's include directory. ```cmake install( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/igraph FILES_MATCHING PATTERN "*.h" ) ``` -------------------------------- ### Run R Script with source() Example Source: https://github.com/igraph/rigraph/blob/main/revdep/examples/README.md Demonstrates how to run a reverse dependency example script using the source() function in R. ```r source("revdep/examples/tidygraph-bfs-father-issue.R") ``` -------------------------------- ### Installation Failure Summary Source: https://github.com/igraph/rigraph/blob/main/revdep/failures.md This snippet shows a general installation failure message for the spopt package. It indicates that the installation process failed and directs the user to a log file for more details. ```text * checking whether package ‘spopt’ can be installed ... ERROR Installation failed. See ‘/tmp/workdir/spopt/new/spopt.Rcheck/00install.out’ for details. ``` -------------------------------- ### Install Recommended R Packages Source: https://github.com/igraph/rigraph/wiki/Testing-with-sanitizers Installs the recommended packages for R. This is a necessary step before building R, ensuring all dependencies are met. ```bash tools/rsync-recommended ``` -------------------------------- ### Install Documentation Tools Source: https://github.com/igraph/rigraph/blob/main/CONTRIBUTING.md Installs the necessary R packages for documentation, including roxygen2 and igraph.r2cdocs. ```r install.packages("roxygen2") pak::pak("igraph/igraph.r2cdocs") ``` -------------------------------- ### Install Library Targets Source: https://github.com/igraph/rigraph/blob/main/src/vendor/simpleraytracer/CMakeLists.txt Defines installation rules for the simpleraytracer library, specifying where to place the library, archive, and runtime files on the system. ```cmake install( TARGETS simpleraytracer LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) ``` -------------------------------- ### Install Pkg-config File Source: https://github.com/igraph/rigraph/blob/main/src/vendor/cigraph/src/CMakeLists.txt Installs the pkg-config file for the igraph library. ```cmake install( FILES ${PROJECT_BINARY_DIR}/igraph.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig ) ``` -------------------------------- ### Install CMake Configuration Files Source: https://github.com/igraph/rigraph/blob/main/src/vendor/cigraph/src/CMakeLists.txt Installs the main CMake configuration files for the igraph package. ```cmake install( FILES ${PROJECT_BINARY_DIR}/igraph-config.cmake ${PROJECT_BINARY_DIR}/igraph-config-version.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/igraph ) ``` -------------------------------- ### Install Header Files from Build Directory Source: https://github.com/igraph/rigraph/blob/main/src/vendor/cigraph/src/CMakeLists.txt Installs header files generated during the build process from the project's binary directory. ```cmake install( DIRECTORY ${PROJECT_BINARY_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/igraph FILES_MATCHING PATTERN "*.h" ) ``` -------------------------------- ### Install R/igraph Dependencies on Windows (R >= 4.0) Source: https://github.com/igraph/rigraph/blob/main/README.md Install required glpk and libxml2 development libraries for R/igraph compilation on Windows using pacman, assuming RTools is installed. ```bash pacman -Sy mingw-w64-{i686,x86_64}-glpk mingw-w64-{i686,x86_64}-libxml2 ``` -------------------------------- ### Community Leading Eigenvector Callback with Start Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Demonstrates the usage of `community_leading_eigenvector_callback_closure_impl` with a starting membership vector. Shows the resulting membership and modularity. ```R cat("Result with start membership:\n") cat("Membership length:\n") print(length(result$membership)) cat("\nModularity:\n") print(result$modularity) ``` -------------------------------- ### Configure R Build with Custom Prefix Source: https://github.com/igraph/rigraph/wiki/Testing-with-sanitizers Run the configure script to set up the R build, specifying a custom installation prefix. Ensure required libraries are installed and flags are correctly set if errors occur. ```bash ./configure --prefix=$HOME/rsan ``` -------------------------------- ### spopt Package Installation (CRAN) Source: https://github.com/igraph/rigraph/blob/main/revdep/failures.md This log shows the source installation attempt for the spopt package in a CRAN context. Similar to the devel installation, it fails due to a Rust compiler version incompatibility, this time with the 'rayon-core' crate requiring Rustc 1.80+ while 1.75.0 is active. ```text * installing *source* package ‘spopt’ ... ** this is package ‘spopt’ version ‘0.1.2’ ** package ‘spopt’ successfully unpacked and MD5 sums checked ** using staged installation Using cargo 1.75.0 Using rustc 1.75.0 (82e1608df 2023-12-21) (built from a source tarball) Building for CRAN. Writing `src/Makevars`. `tools/config.R` has finished. ** libs using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0’ gcc -std=gnu2x -I"/opt/R/4.5.1/lib/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -c entrypoint.c -o entrypoint.o if [ -d ./vendor ]; then \ echo "=== Using offline vendor directory ==="; \ mkdir -p /tmp/workdir/spopt/old/spopt.Rcheck/00_pkg_src/spopt/src/.cargo && \ cp rust/vendor-config.toml /tmp/workdir/spopt/old/spopt.Rcheck/00_pkg_src/spopt/src/.cargo/config.toml; \ elif [ -f ./rust/vendor.tar.xz ]; then \ echo "=== Using offline vendor tarball ==="; \ tar xf rust/vendor.tar.xz && \ mkdir -p /tmp/workdir/spopt/old/spopt.Rcheck/00_pkg_src/spopt/src/.cargo && \ cp rust/vendor-config.toml /tmp/workdir/spopt/old/spopt.Rcheck/00_pkg_src/spopt/src/.cargo/config.toml; \ fi === Using offline vendor tarball === export CARGO_HOME=/tmp/workdir/spopt/old/spopt.Rcheck/00_pkg_src/spopt/src/.cargo && \ export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.cargo/bin" && \ RUSTFLAGS=" --print=native-static-libs" cargo build -j 2 --offline --lib --release --manifest-path=./rust/Cargo.toml --target-dir ./rust/target error: package `rayon-core v1.13.0` cannot be built because it requires rustc 1.80 or newer, while the currently active rustc version is 1.75.0 Either upgrade to rustc 1.80 or newer, or use cargo update rayon-core@1.13.0 --precise ver where `ver` is the latest version of `rayon-core` supporting rustc 1.75.0 make: *** [Makevars:27: rust/target/release/libspopt.a] Error 101 ERROR: compilation failed for package ‘spopt’ * removing ‘/tmp/workdir/spopt/old/spopt.Rcheck/spopt’ ``` -------------------------------- ### get_all_shortest_paths_impl basic usage Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Provides a basic example of `get_all_shortest_paths_impl` with a valid graph. ```R get_all_shortest_paths_impl(graph = g, from = 1, to = 3) ``` -------------------------------- ### Install UUID Library Source: https://github.com/igraph/rigraph/blob/main/src/vendor/uuid/CMakeLists.txt Installs the UUID library targets (library, archive, runtime) to their respective destinations. ```cmake install( TARGETS uuid LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) ``` -------------------------------- ### Install igraph Development Version Source: https://github.com/igraph/rigraph/blob/main/CONTRIBUTING.md Install the development version of igraph from GitHub using remotes or pak. Optionally, specify a separate library location to avoid conflicts with a stable installation. ```R remotes::install_github("igraph/rigraph") ``` ```R pak::pak("igraph/rigraph") ``` ```R remotes::install_github("igraph/rigraph", lib = "~/testing/") ``` -------------------------------- ### Basic Usage of get_all_simple_paths_impl Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Provides a basic example of finding all simple paths between two vertices using `get_all_simple_paths_impl`. ```R get_all_simple_paths_impl(graph = g, from = 1, to = 3) ``` -------------------------------- ### Install GitHub CLI on macOS Source: https://github.com/igraph/rigraph/blob/main/revdep/NOTIFY-README.md Installs the GitHub CLI using Homebrew on macOS. This is a prerequisite for creating GitHub issues. ```bash # Install GitHub CLI # On macOS: brew install gh ``` -------------------------------- ### Installation Failure Message Source: https://github.com/igraph/rigraph/blob/main/revdep/failures.md Indicates that the installation of the 'scAnnotate' package failed. Details can be found in the specified log file. ```text Installation failed. See ‘/tmp/workdir/scAnnotate/new/scAnnotate.Rcheck/00install.out’ for details. ``` -------------------------------- ### Install git-subrepo on macOS Source: https://github.com/igraph/rigraph/blob/main/tools/README.md Install the git-subrepo tool on macOS using Homebrew. Alternatively, you can install from source and source the rc file. ```sh # On macOS with Homebrew brew install git-subrepo # Or install from source git clone https://github.com/ingydotnet/git-subrepo /path/to/git-subrepo echo 'source /path/to/git-subrepo/.rc' >> ~/.zshrc ``` -------------------------------- ### Install Windows Dependencies Source: https://github.com/igraph/rigraph/blob/main/CONTRIBUTING.md Install required system dependencies (glpk and libxml2) for building the igraph package from source on Windows using RTools. ```sh pacman -Sy mingw-w64-{i86,x86_64}-glpk mingw-w64-{i86,x86_64}-libxml2 ``` -------------------------------- ### Install All Dependencies with pak Source: https://github.com/igraph/rigraph/blob/main/AGENTS.md Installs all necessary package dependencies for the igraph project using the pak package manager. ```r pak::pak() ``` -------------------------------- ### Basic layout_sphere_impl (example 1) Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Demonstrates the basic usage of the layout_sphere_impl function to generate a spherical layout for a graph. ```R layout_sphere_impl(graph = g) ``` -------------------------------- ### R6causal Install Warnings Source: https://github.com/igraph/rigraph/blob/main/revdep/examples/r6causal-attribute-deprecations-issue.md Shows the deprecation warnings generated during the R6causal package installation check. ```text checking whether package ‘R6causal’ can be installed ... WARNING Found the following significant warnings: Warning: `set.edge.attribute()` was deprecated in igraph 2.0.0. Warning: `induced.subgraph()` was deprecated in igraph 2.0.0. Warning: `get.vertex.attribute()` was deprecated in igraph 2.0.0. ``` -------------------------------- ### migraph: Tutorial Code Example Source: https://github.com/igraph/rigraph/blob/main/revdep/problems-analysis.md Illustrates a specific line of code from a migraph tutorial that triggered a deprecation warning on an older igraph version. ```R rg <- create_ring(32, width = 2) ``` -------------------------------- ### random_walk_impl Basic Usage Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Provides an example of random_walk_impl with default settings. ```R random_walk_impl(graph = g, start = 1, steps = 2) ``` -------------------------------- ### min_st_separators Example Output Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/flow.md Shows the successful output for the `min_st_separators` function in a note case. ```r min_st_separators(g_note) ``` -------------------------------- ### Basic Vertex Connectivity Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Demonstrates a basic example of calculating vertex connectivity for a graph using `vertex_connectivity_impl`. ```R vertex_connectivity_impl(graph = g) ``` -------------------------------- ### Install R/igraph Dependencies on Fedora Source: https://github.com/igraph/rigraph/blob/main/README.md Install the necessary development packages for glpk and libxml2 on Fedora systems to compile R/igraph from source. ```bash yum install glpk-devel libxml2-devel ``` -------------------------------- ### Reproducible Example of defunct method in sample_degseq Source: https://github.com/igraph/rigraph/blob/main/revdep/examples/qgraph-sample-degseq-method-issue.md Demonstrates the error when using the defunct 'simple.no.multiple' method and shows the correct replacement using 'fast.heur.simple'. ```r library(igraph) deg <- rep(2, 10) sample_degseq(deg, method = "simple.no.multiple") #> Error: #> ! The `method` argument of `sample_degseq()` must be fast.heur.simple #> instead of simple.no.multiple as of igraph 2.1.0. # Working replacement sample_degseq(deg, method = "fast.heur.simple") ``` -------------------------------- ### Basic Usage of get_widest_path_impl Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Shows a basic example of finding the widest path between two vertices using get_widest_path_impl with specified weights. ```R get_widest_path_impl(graph = g, from = 1, to = 3, weights = c(1, 2)) ``` -------------------------------- ### Install CMake Export File Source: https://github.com/igraph/rigraph/blob/main/src/vendor/cigraph/src/CMakeLists.txt Installs the CMake export file that defines targets for imported igraph components. ```cmake install( EXPORT igraph_targets FILE igraph-targets.cmake NAMESPACE igraph:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/igraph ) ``` -------------------------------- ### igraph subgraph output example Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/trees.md Example output from an igraph operation, showing graph attributes and edge list. ```text IGRAPH U--- 13 11 -- + attr: name_1 (g/c), name_2 (g/c), loops_1 (g/l), loops_2 (g/l) + edges: [1] 1-- 2 1-- 8 3-- 6 3-- 8 4-- 5 5-- 7 6-- 7 9--11 9--13 10--13 [11] 12--13 ``` -------------------------------- ### spopt Package Installation (Devel) Source: https://github.com/igraph/rigraph/blob/main/revdep/failures.md This log details the source installation process for the spopt package in a development environment. It highlights a critical error where a Rust dependency ('indexmap') requires a newer Rust compiler version (1.82+) than the one detected (1.75.0), leading to compilation failure. ```text * installing *source* package ‘spopt’ ... ** this is package ‘spopt’ version ‘0.1.2’ ** package ‘spopt’ successfully unpacked and MD5 sums checked ** using staged installation Using cargo 1.75.0 Using rustc 1.75.0 (82e1608df 2023-12-21) (built from a source tarball) Building for CRAN. Writing `src/Makevars`. `tools/config.R` has finished. ** libs using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0’ gcc -std=gnu2x -I"/opt/R/4.5.1/lib/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -c entrypoint.c -o entrypoint.o if [ -d ./vendor ]; then \ echo "=== Using offline vendor directory ==="; \ mkdir -p /tmp/workdir/spopt/new/spopt.Rcheck/00_pkg_src/spopt/src/.cargo && \ cp rust/vendor-config.toml /tmp/workdir/spopt/new/spopt.Rcheck/00_pkg_src/spopt/src/.cargo/config.toml; \ elif [ -f ./rust/vendor.tar.xz ]; then \ echo "=== Using offline vendor tarball ==="; \ tar xf rust/vendor.tar.xz && \ mkdir -p /tmp/workdir/spopt/new/spopt.Rcheck/00_pkg_src/spopt/src/.cargo && \ cp rust/vendor-config.toml /tmp/workdir/spopt/new/spopt.Rcheck/00_pkg_src/spopt/src/.cargo/config.toml; \ fi === Using offline vendor tarball === export CARGO_HOME=/tmp/workdir/spopt/new/spopt.Rcheck/00_pkg_src/spopt/src/.cargo && \ export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.cargo/bin" && \ RUSTFLAGS=" --print=native-static-libs" cargo build -j 2 --offline --lib --release --manifest-path=./rust/Cargo.toml --target-dir ./rust/target error: package `indexmap v2.12.1` cannot be built because it requires rustc 1.82 or newer, while the currently active rustc version is 1.75.0 Either upgrade to rustc 1.82 or newer, or use cargo update indexmap@2.12.1 --precise ver where `ver` is the latest version of `indexmap` supporting rustc 1.75.0 make: *** [Makevars:27: rust/target/release/libspopt.a] Error 101 ERROR: compilation failed for package ‘spopt’ * removing ‘/tmp/workdir/spopt/new/spopt.Rcheck/spopt’ ``` -------------------------------- ### Check if a Graph is Chordal (Example 2) Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md This example uses `is_chordal_impl` on a different graph (`g2`) to demonstrate a non-chordal graph and its fill-in edges. ```R is_chordal_impl(graph = g2, alpha = alpha_vec2, alpham1 = alpham1_vec2) ``` -------------------------------- ### Install R/igraph Development Version from GitHub using pak Source: https://github.com/igraph/rigraph/blob/main/README.md Install the development version of R/igraph directly from its GitHub repository using the 'pak' package manager. This is useful for testing the latest features. ```r pak::pak("igraph/rigraph") ``` -------------------------------- ### Get girth of a graph using girth_impl Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Basic usage example for `girth_impl` to retrieve the girth of a graph. The result is accessed via the '$girth' attribute. ```R result$girth ``` -------------------------------- ### Configure R-universe Repository for R/igraph Source: https://github.com/igraph/rigraph/blob/main/README.md Set up your R session to use the igraph R-universe repository for installing the development version. This ensures you get the latest updates. ```r options( repos = c( igraph = 'https://igraph.r-universe.dev', CRAN = 'https://cloud.r-project.org' ) ) install.packages('igraph') ``` -------------------------------- ### Caugi Package Installation Failure (Devel) Source: https://github.com/igraph/rigraph/blob/main/revdep/failures.md Illustrates an installation failure for the 'caugi' package in development mode, specifically due to an unsupported Rust version. ```R * installing *source* package ‘caugi’ ... ** this is package ‘caugi’ version ‘1.2.0’ ** package ‘caugi’ successfully unpacked and MD5 sums checked ** using staged installation Error in eval(ei, envir) : ------------------ [UNSUPPORTED RUST VERSION]------------------ - Minimum supported Rust version is 1.80.0. - Installed Rust version is 1.75.0. --------------------------------------------------------------- Calls: source -> withVisible -> eval -> eval Execution halted ERROR: configuration failed for package ‘caugi’ * removing ‘/tmp/workdir/caugi/new/caugi.Rcheck/caugi’ ``` -------------------------------- ### ggpicrust2 Package Installation Check Log Source: https://github.com/igraph/rigraph/blob/main/revdep/failures.md This log details the checks performed by revdepcheck for the ggpicrust2 package. It covers environment setup, package integrity, dependency checks, code and documentation validation, and test execution. The output indicates that the package can be installed and loaded without critical errors. ```log * using log directory ‘/tmp/workdir/ggpicrust2/new/ggpicrust2.Rcheck’ * using R version 4.5.1 (2025-06-13) * using platform: x86_64-pc-linux-gnu * R was compiled by gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 * running under: Ubuntu 24.04.4 LTS * using session charset: UTF-8 * using option ‘--no-manual’ * checking for file ‘ggpicrust2/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘ggpicrust2’ version ‘2.5.16’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... INFO Package suggested but not available for checking: ‘lefser’ * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘ggpicrust2’ can be installed ... OK * checking installed package size ... INFO installed size is 9.5Mb sub-directories of 1Mb or more: data 6.5Mb extdata 1.0Mb help 1.4Mb * checking package directory ... OK * checking ‘build’ directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking code files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking whether startup messages can be suppressed ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking contents of ‘data’ directory ... OK * checking data for non-ASCII characters ... OK * checking LazyData ... OK * checking data for ASCII and uncompressed saves ... OK * checking installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK * checking examples ... OK * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... OK Running ‘testthat.R’ * checking for unstated dependencies in vignettes ... OK * checking package vignettes ... OK * checking re-building of vignette outputs ... OK * DONE Status: OK ``` -------------------------------- ### Usage of maximal_cliques_hist_impl with size constraints Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Demonstrates using `maximal_cliques_hist_impl` with `min_size` and `max_size` to get a histogram of maximal cliques within a specific size range. This example focuses on cliques of size 2. ```R maximal_cliques_hist_impl(graph = g, min_size = 2, max_size = 2) ``` -------------------------------- ### Basic Moran process implementation Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Demonstrates the basic usage of `moran_process_impl` with a graph, weights, quantities, strategies, and 'in' mode. ```R moran_process_impl(graph = g, weights = c(1, 1), quantities = c(1, 2, 3), strategies = c(1, 2, 3), mode = "in") ``` -------------------------------- ### Basic rooted_product_impl Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Demonstrates the basic usage of the rooted_product_impl function with two graphs and a specified root. ```R rooted_product_impl(g1 = g1, g2 = g2, root = 1) ``` -------------------------------- ### Basic usage of random_spanning_tree_impl Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Demonstrates how to generate a random spanning tree from a graph `g` starting from vertex 1 using `random_spanning_tree_impl`. ```R random_spanning_tree_impl(graph = g, vid = 1) ``` -------------------------------- ### sbm_game_impl with Directed and Loops Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Shows how to use `sbm_game_impl` to generate a directed graph with self-loops. This example highlights the parameters for controlling graph directionality and the inclusion of loops. ```R sbm_game_impl(n = 5, pref_matrix = matrix(0.5, 2, 2), block_sizes = c(2, 3), directed = TRUE, loops = TRUE) ``` -------------------------------- ### Basic Usage of get_k_shortest_paths_impl Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Illustrates how to find the k-shortest paths between two vertices using `get_k_shortest_paths_impl`. ```R get_k_shortest_paths_impl(graph = g, from = 1, to = 3, k = 2) ``` -------------------------------- ### blavaan Package Installation Error Source: https://github.com/igraph/rigraph/blob/main/revdep/failures.md This snippet shows the general error message when the blavaan package fails to install. It indicates that the installation failed and directs the user to a log file for details. ```text * checking whether package ‘blavaan’ can be installed ... ERROR Installation failed. See ‘/tmp/workdir/blavaan/new/blavaan.Rcheck/00install.out’ for details. ``` -------------------------------- ### scAnnotate Package Installation Error (Devel) Source: https://github.com/igraph/rigraph/blob/main/revdep/failures.md Shows the build process for the 'scAnnotate' package (devel version) failing during byte-compilation due to an unexported object from the 'harmony' namespace. ```r * installing *source* package ‘scAnnotate’ ... ** this is package ‘scAnnotate’ version ‘0.3’ ** package ‘scAnnotate’ successfully unpacked and MD5 sums checked ** using staged installation ** R ** data *** moving datasets to lazyload DB ** inst ** byte-compile and prepare package for lazy loading Error: object ‘HarmonyMatrix’ is not exported by 'namespace:harmony' Execution halted ERROR: lazy loading failed for package ‘scAnnotate’ * removing ‘/tmp/workdir/scAnnotate/new/scAnnotate.Rcheck/scAnnotate’ ``` -------------------------------- ### asymmetric_preference_game_impl basic usage Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Provides a basic example of generating a directed graph with asymmetric preferences using asymmetric_preference_game_impl. ```R asymmetric_preference_game_impl(nodes = 5, out_types = 2, in_types = 2, type_dist_matrix = matrix(c(0.5, 0.5, 0.5, 0.5), 2, 2), pref_matrix = matrix( c(0.5, 0.5, 0.5, 0.5), 2, 2)) ``` -------------------------------- ### preference_game_impl basic usage Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Shows a basic example of creating a graph using preference_game_impl with specified node types and preferences. ```R preference_game_impl(nodes = 5, types = 2, type_dist = c(0.5, 0.5), fixed_sizes = FALSE, pref_matrix = matrix(c(0.5, 0.5, 0.5, 0.5), 2, 2)) ``` -------------------------------- ### Basic cycle finding with callback Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Illustrates the basic usage of `simple_cycles_callback_closure_impl` for finding simple cycles and processing them with a callback. Shows how to print the result and the details of the first cycle found. ```R cat("Result:\n") print(result) cat("\nNumber of cycles found:", length(cycle_data), "\n") cat("First cycle:\n") print(cycle_data[[1]]) ``` -------------------------------- ### Perform Simple Breadth-First Search (BFS) Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Performs a simple BFS starting from a specified root vertex, returning traversal order, layers, and parents. ```R bfs_simple_impl(graph = g, root = 1) ``` -------------------------------- ### laplacian_spectral_embedding_impl Basic Usage Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Shows a basic usage example of laplacian_spectral_embedding_impl with a valid graph object and outputs the resulting embedding matrices and options. ```R laplacian_spectral_embedding_impl(graph = g, no = 2) ``` -------------------------------- ### Basic Edge Connectivity Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Shows a basic example of calculating edge connectivity for a graph using `edge_connectivity_impl`. ```R edge_connectivity_impl(graph = g) ``` -------------------------------- ### Site Percolation Error Handling Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Shows an example of an error condition when site_percolation_impl is called with a NULL graph object. ```R site_percolation_impl(graph = NULL) ``` -------------------------------- ### k_regular_game_impl Error Example Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Demonstrates an error case for `k_regular_game_impl` when a negative number of nodes is provided. The function requires a non-negative node count. ```R k_regular_game_impl(no_of_nodes = -1, k = 2) ``` -------------------------------- ### Vertex Dependency Example Source: https://github.com/igraph/rigraph/blob/main/tools/py-stimulus/docs/index.mdx Shows a specific dependency for vertex specification, where 'vids' depends on 'graph'. 'R' ensures vertex sequences are correct, translating names to indices. ```text DEPS: vids ON graph ``` -------------------------------- ### Generate Pkgconfig File Source: https://github.com/igraph/rigraph/blob/main/src/vendor/cigraph/src/CMakeLists.txt Includes helper functions for generating pkgconfig files. This is essential for making the installed library discoverable by other projects using pkg-config. ```cmake # Generate pkgconfig file include(pkgconfig_helpers) ``` -------------------------------- ### solve_lsap_impl Basic Usage Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Demonstrates the basic usage of solve_lsap_impl with a cost matrix and number of agents. ```R solve_lsap_impl(c = matrix(1:4, ncol = 2), n = 2) ``` -------------------------------- ### Basic Usage of get_isomorphisms_vf2_callback_closure_impl Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Illustrates the basic output and results when using `get_isomorphisms_vf2_callback_closure_impl` to find isomorphisms. It shows how to print the results and count the number of isomorphisms found. ```R cat("Result:\n") print(result) cat("\nNumber of isomorphisms found:", length(iso_data), "\n") cat("First isomorphism:\n") print(iso_data[[1]]) ``` -------------------------------- ### Install Build Dependencies with pak Source: https://github.com/igraph/rigraph/blob/main/AGENTS.md Installs only the build-specific dependencies for the igraph project using the pak package manager. ```r pak::pak(dependencies = "Config/Needs/build") ``` -------------------------------- ### Basic Usage of get_subisomorphisms_vf2_callback_closure_impl Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Demonstrates the basic output and results when using `get_subisomorphisms_vf2_callback_closure_impl` to find subisomorphisms. It includes printing the results and counting the number of subisomorphisms found. ```R cat("Result:\n") print(result) cat("\nNumber of subisomorphisms found:", length(subiso_data), "\n") cat("First subisomorphism:\n") print(subiso_data[[1]]) ``` -------------------------------- ### Check if a Graph is Chordal (Example 1) Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md The `is_chordal_impl` function checks if a graph is chordal. This example demonstrates a chordal graph. ```R is_chordal_impl(graph = g, alpha = alpha_vec, alpham1 = alpham1_vec) ``` -------------------------------- ### get_all_shortest_paths_dijkstra_impl basic usage Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Demonstrates the basic functionality of `get_all_shortest_paths_dijkstra_impl`. ```R get_all_shortest_paths_dijkstra_impl(graph = g, from = 1, to = 3) ``` -------------------------------- ### Reproducible Example of Defunct layout.spring() Source: https://github.com/igraph/rigraph/blob/main/revdep/examples/comato-layout-spring-issue.md Demonstrates the error when calling the defunct igraph::layout.spring() function and shows the working replacement using layout_with_fr(). ```r library(igraph) g <- make_ring(10) # Old call -- now defunct layout.spring(g) #> Error: #> ! `layout.spring()` was deprecated in igraph 2.1.0 and is now defunct. #> i Please use `layout_with_fr()` instead. # Working replacement coords <- layout_with_fr(g) ``` -------------------------------- ### Correct usage of bfs() Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/structural-properties.md Shows a working example of the `bfs()` function with various arguments to explore graph structure. This demonstrates how to correctly use arguments like `mode`, `order`, `rank`, `parent`, `pred`, `succ`, and `dist`. ```R g <- graph_from_literal(a - +b - +c, z - +a, d) bfs(g, root = 2, mode = "out", unreachable = FALSE, order = TRUE, rank = TRUE, parent = TRUE, pred = TRUE, succ = TRUE, dist = TRUE) ``` -------------------------------- ### Review Source and Configure Changes Source: https://github.com/igraph/rigraph/blob/main/src/README.md Compares the current state of src/ and configure files against the last commit. Use this to review changes after updating sources. ```sh git diff src/ configure ``` -------------------------------- ### Basic usage of sample_sphere_volume_impl Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Illustrates the basic functionality of `sample_sphere_volume_impl` for sampling points within a sphere's volume. ```R sample_sphere_volume_impl(dim = 3, n = 5) ``` -------------------------------- ### stochastic_imitation_impl basic usage (algo 1) Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Basic usage of stochastic_imitation_impl with algorithm 1. ```R stochastic_imitation_impl(graph = g, vid = 1, algo = 1, quantities = c(1, 2, 3), strategies = c(1, 2, 3)) ``` -------------------------------- ### Caugi Package Installation Failure (CRAN) Source: https://github.com/igraph/rigraph/blob/main/revdep/failures.md Details an installation failure for the 'caugi' package from CRAN, also caused by an unsupported Rust version. ```R * installing *source* package ‘caugi’ ... ** this is package ‘caugi’ version ‘1.2.0’ ** package ‘caugi’ successfully unpacked and MD5 sums checked ** using staged installation Error in eval(ei, envir) : ------------------ [UNSUPPORTED RUST VERSION]------------------ - Minimum supported Rust version is 1.80.0. - Installed Rust version is 1.75.0. --------------------------------------------------------------- Calls: source -> withVisible -> eval -> eval Execution halted ERROR: configuration failed for package ‘caugi’ * removing ‘/tmp/workdir/caugi/old/caugi.Rcheck/caugi’ ``` -------------------------------- ### Install R/igraph Dependencies on Debian/Ubuntu Source: https://github.com/igraph/rigraph/blob/main/README.md Install the necessary development packages for glpk and libxml2 on Debian or Ubuntu systems to compile R/igraph from source. ```bash apt install libglpk-dev libxml2-dev ``` -------------------------------- ### Basic Site Percolation Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Demonstrates the basic usage of the site_percolation_impl function to calculate giant component size and edge count. ```R site_percolation_impl(graph = g) ``` -------------------------------- ### Stimulus Command Line Usage Source: https://github.com/igraph/rigraph/blob/main/tools/py-stimulus/docs/index.mdx This shows the basic command-line arguments for invoking the Stimulus tool. Use definition files for functions and types, specify the target language, input, and output files. ```bash stimulus -f -t -l language -i -o -h --help -v ``` -------------------------------- ### Sample sphere surface with custom radius and sign Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Shows how to use `sample_sphere_surface_impl` with a specified radius and to sample points with both positive and negative coordinates. ```R sample_sphere_surface_impl(dim = 3, n = 5, radius = 2, positive = FALSE) ``` -------------------------------- ### Basic usage of sample_sphere_surface_impl Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Illustrates the basic functionality of `sample_sphere_surface_impl` for sampling points on a sphere's surface. ```R sample_sphere_surface_impl(dim = 3, n = 5) ``` -------------------------------- ### Install Stable R/igraph from CRAN Source: https://github.com/igraph/rigraph/blob/main/README.md Use this command to install the latest stable version of the R/igraph package from the Comprehensive R Archive Network (CRAN). ```r install.packages("igraph") ``` -------------------------------- ### Boptbd Example Error: tkplot Deprecation Source: https://github.com/igraph/rigraph/blob/main/revdep/problems.md This example from the Boptbd package fails because the `tkplot()` function, used internally by `graphoptBbd`, has been deprecated and is now defunct in igraph version 3.0.0. ```R ##To create the graphical layout of the D-optimal block design ##obtained using the treatment exchange algorithm for trt.N <- 10 #Number of treatments blk.N <- 10 #Number of blocks alpha <- 0.1 #alpha value beta <- 0.1 #beta value OptdesF <- rbind(1:10, c(2:10,1)) #Bayesian A-optimal block design (loop design) graphoptBbd(trt.N = 10, blk.N = 10, alpha = 0.1, beta = 0.1, OptdesF, Optcrit = "A") ``` -------------------------------- ### Error: Unknown constructor for sample_() Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/make.md Demonstrates the error message when sample_() is called without arguments or with invalid arguments. ```R sample_() ``` ```R sample_(1:10) ``` -------------------------------- ### ggm package example error with deprecated tkplot Source: https://github.com/igraph/rigraph/blob/main/revdep/problems.md This snippet shows an error encountered during the example execution of the 'ggm' package. It highlights the deprecation of 'tkplot' in igraph version 3.0.0. ```R ... + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0, + 0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0),16,16,byrow=TRUE) > M <- c(3,5,6,15,16) > C <- c(4,7) > AG(ex, M, C, plot = TRUE) Warning: `graph()` was deprecated in igraph 2.1.0. ℹ Please use `make_graph()` instead. ℹ The deprecated feature was likely used in the ggm package. Please report the issue to the authors. Warning: `get.edgelist()` was deprecated in igraph 2.0.0. ℹ Please use `as_edgelist()` instead. ℹ The deprecated feature was likely used in the ggm package. Please report the issue to the authors. Error: ! `tkplot()` was deprecated in igraph 3.0.0 and is now defunct. Backtrace: ▆ 1. └─ggm::AG(ex, M, C, plot = TRUE) 2. └─ggm (local) plotfun(fr, ...) 3. └─igraph::tkplot(...) 4. └─lifecycle::deprecate_stop("3.0.0", "tkplot()") 5. └─lifecycle:::deprecate_stop0(msg) 6. └─rlang::cnd_signal(...) Execution halted ``` -------------------------------- ### Basic deterministic optimal imitation Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Demonstrates the basic usage of `deterministic_optimal_imitation_impl` with specified graph, vertex ID, quantities, and strategies. ```R deterministic_optimal_imitation_impl(graph = g, vid = 1, quantities = c(1, 2, 3), strategies = c(1, 2, 3)) ``` -------------------------------- ### Example Check Error in GoodFitSBM Source: https://github.com/igraph/rigraph/blob/main/revdep/problems.md This snippet shows an error encountered during the example checks for the GoodFitSBM package, indicating a problem with deprecated igraph functions and API changes related to edge ID retrieval. ```R ... ℹ The deprecated feature was likely used in the GoodFitSBM package. Please report the issue at . Warning: `get.edge.ids()` was deprecated in igraph 2.1.0. ℹ Please use `get_edge_ids()` instead. ℹ The deprecated feature was likely used in the GoodFitSBM package. Please report the issue at . Error: ! The `vp` argument of `get_edge_ids()` supplied as a matrix should be a n times 2 matrix, not 2 times n as of igraph 2.1.5. ℹ either transpose the matrix with t() or convert it to a data.frame with two columns. Backtrace: ▆ 1. └─GoodFitSBM::goftest_BetaSBM(adjsymm, C = class, numGraphs = 10) 2. └─GoodFitSBM::sample_a_move_BetaSBM(C, G) 3. └─GoodFitSBM:::Get.Next.Network(...) 4. └─GoodFitSBM:::Get.Move.beta.SBM(b, blocks = SBM.blocks, coin = beta.SBM.coin) 5. └─GoodFitSBM:::Get.Induced.Subgraph(g, v.block[[i]]) 6. └─igraph::get.edge.ids(g, pairs) 7. └─igraph::get_edge_ids(...) 8. └─igraph:::el_to_vec(vp, call = rlang::caller_env()) 9. └─lifecycle::deprecate_stop(...) 10. └─lifecycle:::deprecate_stop0(msg) 11. └─rlang::cnd_signal(...) Execution halted ``` -------------------------------- ### Configure Package Configuration File Source: https://github.com/igraph/rigraph/blob/main/src/vendor/cigraph/src/CMakeLists.txt Configures the igraph-config.cmake file, which allows users to find the installed igraph library using CMake's FIND_PACKAGE command. It sets the installation destination according to Debian/Ubuntu conventions. ```cmake # Provide an igraph-config.cmake file in the installation directory so # users can find the installed igraph library with FIND_PACKAGE(igraph) # from their CMakeLists.txt files include(CMakePackageConfigHelpers) configure_package_config_file( ${PROJECT_SOURCE_DIR}/etc/cmake/igraph-config.cmake.in ${PROJECT_BINARY_DIR}/igraph-config.cmake # Install destination selected according to https://wiki.debian.org/CMake # and by looking at how eigen3 does it in Ubuntu INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/igraph ) ``` -------------------------------- ### simplify_and_colorize_impl Basic Usage Source: https://github.com/igraph/rigraph/blob/main/tests/testthat/_snaps/aaa-auto.md Shows the basic output of simplify_and_colorize_impl with a sample graph. ```R simplify_and_colorize_impl(graph = g) ``` -------------------------------- ### Deprecated igraph functions in qgraph examples Source: https://github.com/igraph/rigraph/blob/main/revdep/problems.md This snippet shows warnings from qgraph examples using deprecated igraph functions like `watts.strogatz.game()`, `average.path.length()`, and `degree.sequence.game()`. These functions have been replaced by newer alternatives in igraph 2.0.0. ```R ... Warning: `watts.strogatz.game()` was deprecated in igraph 2.0.0. ℹ Please use `sample_smallworld()` instead. > smallworldness(regnet, B=10) Warning: `average.path.length()` was deprecated in igraph 2.0.0. ℹ Please use `mean_distance()` instead. ℹ The deprecated feature was likely used in the qgraph package. Please report the issue at . Warning: `degree.sequence.game()` was deprecated in igraph 2.0.0. ℹ Please use `sample_degseq()` instead. ℹ The deprecated feature was likely used in the qgraph package. Please report the issue at . Error: ! The `method` argument of `sample_degseq()` must be fast.heur.simple instead of simple.no.multiple as of igraph 2.1.0. Backtrace: ▆ 1. └─qgraph::smallworldness(regnet, B = 10) 2. └─base::lapply(...) 3. └─qgraph (local) FUN(X[[i]], ...) 4. └─igraph::degree.sequence.game(deg.dist, method = "simple.no.multiple") 5. └─igraph::sample_degseq(out.deg = out.deg, in.deg = in.deg, method = method) 6. └─lifecycle::deprecate_stop("2.1.0", "sample_degseq(method = 'must be fast.heur.simple instead of simple.no.multiple')") 7. └─lifecycle:::deprecate_stop0(msg) 8. └─rlang::cnd_signal(...) Execution halted ``` -------------------------------- ### c3net Example Warnings and Error: Deprecated igraph Functions Source: https://github.com/igraph/rigraph/blob/main/revdep/problems.md This example from the c3net package encounters multiple warnings due to deprecated igraph functions (`graph.adjacency`, `get.edgelist`, `graph.edgelist`) and a fatal error because `tkplot()` is defunct. ```R net <- c3net(expdata, network=TRUE) ``` -------------------------------- ### Dependency Indexing in Templates Source: https://github.com/igraph/rigraph/blob/main/tools/py-stimulus/docs/index.mdx Demonstrates how to reference dependencies within type definition templates using the '%I[dependency number]%' format. '%I1%' refers to the first dependency, and '%I2%' to the second. ```text DEPS: res ON graph vids %I1% refers to graph, and %I2% refers to vids ```