Repository navigation
docs: add topic vignettes - #3034
schochastics wants to merge 23 commits into
Conversation
- Move triad_census.jpg into vignettes/ so the relative image path resolves. - Replace deprecated authority_score()/hub_score() with hits_scores(). - Name the mode argument of graph_from_adjacency_matrix(). - Use delete_edge_attr() (remove_edge_attr() does not exist). - Drop unsupported directed argument from sample_smallworld(). - Align VignetteIndexEntry with the title of the graph generators vignette. - Add the vignettes to the pkgdown Articles menu. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New vignettes: - vertices_edges: vertex/edge sequences, selectors, attributes, matrix indexing, structural modification, attribute combination. - paths: shortest paths, distances, traversal, reachability, flows, cuts and connectivity. - bipartite: creating, plotting, projecting and analyzing two-mode networks. - import_export: data frames, matrices, adjacency lists, file formats and conversion to other packages. - cohesive_subgroups: cliques, k-cores, cohesive blocks and motifs. Rewrite centrality, community_detection, descriptives and graph_generators for clarity and correctness, seed all random examples, and cross-link the vignettes. List them in the pkgdown menu and in the intro vignette. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cross-reference vignettes without `package = "igraph"`, and teach `scripts/flavor.patch` to rename the `library(igraph)` setup chunk of each new vignette, so the flavor package-name check passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The nine topic vignettes move to `vignettes/articles/`, so they are built only for the pkgdown site and no longer by `R CMD check` or CRAN. Cross-references become links, and the flavor patch follows the new paths. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
maelle
left a comment
There was a problem hiding this comment.
Thanks!! Only one reviewed for now. How do you want to proceed?
| articles: | ||
| text: Articles | ||
| menu: | ||
| - text: Vertices, edges and attributes |
There was a problem hiding this comment.
I'll use this as the order for reading.
|
|
||
| This tutorial is a brief introduction to `igraph` in R. We sincerely hope you enjoyed reading it and that it will be useful for your own network analyses. | ||
|
|
||
| The following vignettes cover specific topics in more depth: |
There was a problem hiding this comment.
If there are too many vignettes, with a logical order, maybe ultimately they should become a Quarto book. 😇
| ``` | ||
|
|
||
| ```{r setup} | ||
| library(igraph) |
| library(igraph) | ||
| ``` | ||
|
|
||
| Most analyses do more than compute a statistic for the whole graph. |
There was a problem hiding this comment.
I thought this vignette would start by reminding what vertices and edges are, with the synonyms.
|
|
||
| ```{r graph} | ||
| g <- make_graph( | ||
| ~ Ann - Ben:Cleo:Dev, Ben - Cleo, Cleo - Dev:Eve, Dev - Eve, |
There was a problem hiding this comment.
Could you replace Dev and Eve by more distinct names?
|
|
||
| Vertex and edge IDs are always consecutive integers starting at 1. | ||
| Deleting a vertex or an edge renumbers the ones after it, so a sequence created before a modification may point to the wrong elements afterwards. | ||
| Create sequences from the graph you are working on, and prefer names over IDs when you need to refer to the same vertex across modifications. |
There was a problem hiding this comment.
Callouts aren't supported yet https://pkgdown.r-lib.org/articles/quarto.html
But you could add an emoji, bold text?
| ``` | ||
|
|
||
| This is the same convention as in dplyr. | ||
| In code that others will reuse, such as functions or packages, use the pronouns to avoid surprises. |
There was a problem hiding this comment.
same comment for this important piece of info, could it be more visible?
|
|
||
| | Helper | Use with | Selects | | ||
| |---|---|---| | ||
| | `.nei(v)` | `V()` | neighbors of `v` | |
There was a problem hiding this comment.
Should we consider renaming those to .neighbors? 😇
| V(g)[.nei("Eve") & age > 30] | ||
| ``` | ||
|
|
||
| Outside of brackets, use `neighbors()`, `incident()` and `ends()`. |
There was a problem hiding this comment.
it'd be nice to have some plot of the network at the beginning of the vignette, to refer to it when seeing the results on neighbors
|
|
||
| ## Modifying the structure | ||
|
|
||
| The functions `add_vertices()`, `add_edges()`, `delete_vertices()` and `delete_edges()` change the structure of a graph. |
There was a problem hiding this comment.
explain a bit more, there are new team members etc
# Conflicts: # _pkgdown.yml # scripts/flavor.patch
Unifies the four
vignette-*branches, updates them to the current API, rewrites them, and adds new vignettes on vertices/edges/attributes, paths and flows, bipartite networks, import/export, and cohesive subgroups. All are linked from the pkgdown menu and the intro vignette.