Skip to content

docs: add topic vignettes - #3034

Open
schochastics wants to merge 23 commits into
mainfrom
vignettes-unified
Open

schochastics wants to merge 23 commits into
mainfrom
vignettes-unified

Conversation

@schochastics

@schochastics schochastics commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

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.

schochastics and others added 19 commits July 29, 2025 10:29
- 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>
schochastics and others added 2 commits December 2, 2026 17:24
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 maelle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!! Only one reviewed for now. How do you want to proceed?

Comment thread _pkgdown.yml
articles:
text: Articles
menu:
- text: Vertices, edges and attributes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll use this as the order for reading.

Comment thread vignettes/igraph.Rmd

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:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are too many vignettes, with a logical order, maybe ultimately they should become a Quarto book. 😇

```

```{r setup}
library(igraph)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

silence messages here?

library(igraph)
```

Most analyses do more than compute a statistic for the whole graph.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment for this important piece of info, could it be more visible?


| Helper | Use with | Selects |
|---|---|---|
| `.nei(v)` | `V()` | neighbors of `v` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we consider renaming those to .neighbors? 😇

V(g)[.nei("Eve") & age > 30]
```

Outside of brackets, use `neighbors()`, `incident()` and `ends()`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explain a bit more, there are new team members etc

# Conflicts:
#	_pkgdown.yml
#	scripts/flavor.patch

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants