Skip to content

Commit 48443e0

Browse files
maellekrlmlr
andauthored
docs: Automatic linking to C docs (#2518)
Co-authored-by: Kirill Müller <kirill@cynkra.com>
1 parent 25b223b commit 48443e0

549 files changed

Lines changed: 2051 additions & 435 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CONTRIBUTING.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,7 @@ pak::pak("igraph/igraph.r2cdocs")
154154
[roxygen2](https://roxygen2.r-lib.org/), and run `devtools::document()` or `make
155155
igraph` to update the `.Rd` files.
156156

157-
- Links to C docs are added using the cdocs tag, for instance:
158-
159-
```
160-
#' @cdocs igraph_assortativity
161-
```
157+
- Links to C docs are added automatically thanks to the igraph.r2cdocs's roclet.
162158

163159
### Maintaining igraph.r2cdocs
164160

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Config/testthat/parallel: true
8080
Config/testthat/start-first: aaa-auto, vs-es, scan, vs-operators, weakref,
8181
watts.strogatz.game
8282
Encoding: UTF-8
83-
Roxygen: list(markdown = TRUE, roclets = c("collate", "rd", "namespace", "devtag::dev_roclet"), packages =
84-
"igraph.r2cdocs")
83+
Roxygen: list(markdown = TRUE, roclets = c("collate", "namespace",
84+
"igraph.r2cdocs::docs_rd", "devtag::dev_roclet"))
8585
RoxygenNote: 7.3.3.9000
8686
SystemRequirements: libxml2 (optional), glpk (>= 4.57, optional)

R/assortativity.R

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ assortativity.degree <- function(graph, directed = TRUE) {
160160
#'
161161
#' # BA model, tends to be dissortative
162162
#' assortativity_degree(sample_pa(10000, m = 4))
163-
#' @cdocs igraph_assortativity
164163
assortativity <- function(
165164
graph,
166165
values,
@@ -241,7 +240,6 @@ assortativity_legacy <- function(
241240
#' [as.factor()].
242241
#' @rdname assortativity
243242
#' @export
244-
#' @cdocs igraph_assortativity_nominal
245243
assortativity_nominal <- function(
246244
graph,
247245
types,
@@ -263,7 +261,6 @@ assortativity_nominal <- function(
263261

264262
#' @rdname assortativity
265263
#' @export
266-
#' @cdocs igraph_assortativity_degree
267264
assortativity_degree <- function(graph, directed = TRUE) {
268265
assortativity_degree_impl(
269266
graph = graph,

R/bipartite.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ bipartite_projection <- function(
226226

227227
#' @rdname bipartite_projection
228228
#' @export
229-
#' @cdocs igraph_bipartite_projection_size
230229
bipartite_projection_size <- function(graph, types = NULL) {
231230
bipartite_projection_size_impl(
232231
graph = graph,
@@ -283,7 +282,6 @@ bipartite_projection_size <- function(graph, types = NULL) {
283282
#' bipartite_mapping(g3)
284283
#' @family bipartite
285284
#' @export
286-
#' @cdocs igraph_is_bipartite
287285
bipartite_mapping <- function(graph) {
288286
is_bipartite_impl(
289287
graph = graph

R/centrality.R

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,6 @@ eigen_defaults <- function() {
12911291
#' eigen_centrality(g)
12921292
#' @family centrality
12931293
#' @export
1294-
#' @cdocs igraph_eigenvector_centrality
12951294
eigen_centrality <- function(
12961295
graph,
12971296
directed = FALSE,
@@ -1371,7 +1370,6 @@ eigen_centrality <- function(
13711370
#' strength(g)
13721371
#' @family centrality
13731372
#' @export
1374-
#' @cdocs igraph_strength
13751373
strength <- function(
13761374
graph,
13771375
vids = V(graph),
@@ -1429,7 +1427,6 @@ strength <- function(
14291427
#' diversity(g3)
14301428
#' @family centrality
14311429
#' @export
1432-
#' @cdocs igraph_diversity
14331430
diversity <- function(graph, weights = NULL, vids = V(graph)) {
14341431
diversity_impl(
14351432
graph = graph,
@@ -1497,7 +1494,6 @@ diversity <- function(graph, weights = NULL, vids = V(graph)) {
14971494
#' g2 <- make_ring(10)
14981495
#' hits_scores(g2)
14991496
#' @family centrality
1500-
#' @cdocs igraph_hub_and_authority_scores
15011497
hits_scores <- function(
15021498
graph,
15031499
...,
@@ -1681,7 +1677,6 @@ hub_score <- function(
16811677
#' page_rank(g3, personalized = reset)$vector
16821678
#' @family centrality
16831679
#' @export
1684-
#' @cdocs igraph_personalized_pagerank
16851680
page_rank <- function(
16861681
graph,
16871682
algo = c("prpack", "arpack"),
@@ -1749,7 +1744,6 @@ page_rank <- function(
17491744
#' harmonic_centrality(g2, mode = "out")
17501745
#' harmonic_centrality(g %du% make_full_graph(5), mode = "all")
17511746
#'
1752-
#' @cdocs igraph_harmonic_centrality_cutoff
17531747
harmonic_centrality <- function(
17541748
graph,
17551749
vids = V(graph),

R/centralization.R

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ NULL
314314
#' g1 <- make_star(10, mode = "undirected")
315315
#' centr_eigen(g0)$centralization
316316
#' centr_eigen(g1)$centralization
317-
#' @cdocs igraph_centralization
318317
centralize <- function(scores, theoretical.max = 0, normalized = TRUE) {
319318
centralization_impl(
320319
scores = scores,
@@ -362,7 +361,6 @@ centralize <- function(scores, theoretical.max = 0, normalized = TRUE) {
362361
#' centr_clo(g, mode = "all")$centralization
363362
#' centr_betw(g, directed = FALSE)$centralization
364363
#' centr_eigen(g, directed = FALSE)$centralization
365-
#' @cdocs igraph_centralization_degree
366364
centr_degree <- function(
367365
graph,
368366
mode = c("all", "out", "in", "total"),
@@ -511,7 +509,6 @@ centr_betw <- function(graph, directed = TRUE, normalized = TRUE) {
511509
#' centr_betw(g, normalized = FALSE)$centralization %>%
512510
#' `/`(centr_betw_tmax(g))
513511
#' centr_betw(g, normalized = TRUE)$centralization
514-
#' @cdocs igraph_centralization_betweenness_tmax
515512
centr_betw_tmax <- function(graph = NULL, nodes = 0, directed = TRUE) {
516513
centralization_betweenness_tmax_impl(
517514
graph = graph,
@@ -556,7 +553,6 @@ centr_betw_tmax <- function(graph = NULL, nodes = 0, directed = TRUE) {
556553
#' centr_clo(g, mode = "all")$centralization
557554
#' centr_betw(g, directed = FALSE)$centralization
558555
#' centr_eigen(g, directed = FALSE)$centralization
559-
#' @cdocs igraph_centralization_closeness
560556
centr_clo <- function(
561557
graph,
562558
mode = c("out", "in", "all", "total"),
@@ -593,7 +589,6 @@ centr_clo <- function(
593589
#' centr_clo(g, normalized = FALSE)$centralization %>%
594590
#' `/`(centr_clo_tmax(g))
595591
#' centr_clo(g, normalized = TRUE)$centralization
596-
#' @cdocs igraph_centralization_closeness_tmax
597592
centr_clo_tmax <- function(
598593
graph = NULL,
599594
nodes = 0,
@@ -655,7 +650,6 @@ centr_clo_tmax <- function(
655650
#' g1 <- make_star(10, mode = "undirected")
656651
#' centr_eigen(g0)$centralization
657652
#' centr_eigen(g1)$centralization
658-
#' @cdocs igraph_centralization_eigenvector_centrality
659653
centr_eigen <- function(
660654
graph,
661655
directed = FALSE,
@@ -707,7 +701,6 @@ centr_eigen <- function(
707701
#' centr_eigen(g, normalized = FALSE)$centralization %>%
708702
#' `/`(centr_eigen_tmax(g))
709703
#' centr_eigen(g, normalized = TRUE)$centralization
710-
#' @cdocs igraph_centralization_eigenvector_centrality_tmax
711704
centr_eigen_tmax <- function(
712705
graph = NULL,
713706
nodes = 0,

R/cliques.R

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ clique.number <- function(graph) {
254254
#'
255255
#' # Check that all returned vertex sets are indeed cliques
256256
#' all(sapply(max_cliques(g), function (c) is_clique(g, c)))
257-
#' @cdocs igraph_cliques igraph_cliques_callback
258257
cliques <- function(graph, min = NULL, max = NULL, ..., callback = NULL) {
259258
ensure_igraph(graph)
260259
check_dots_empty()
@@ -280,7 +279,6 @@ cliques <- function(graph, min = NULL, max = NULL, ..., callback = NULL) {
280279

281280
#' @rdname cliques
282281
#' @export
283-
#' @cdocs igraph_largest_cliques
284282
largest_cliques <- function(graph) {
285283
largest_cliques_impl(
286284
graph = graph
@@ -410,7 +408,6 @@ count_max_cliques <- function(graph, min = NULL, max = NULL, subset = NULL) {
410408

411409
#' @rdname cliques
412410
#' @export
413-
#' @cdocs igraph_clique_number
414411
clique_num <- function(graph) {
415412
clique_number_impl(
416413
graph = graph
@@ -467,7 +464,6 @@ clique_num <- function(graph) {
467464
#' weighted_cliques(g, maximal = TRUE)
468465
#' largest_weighted_cliques(g)
469466
#' weighted_clique_num(g)
470-
#' @cdocs igraph_weighted_cliques
471467
weighted_cliques <- function(
472468
graph,
473469
vertex.weights = NULL,
@@ -485,7 +481,6 @@ weighted_cliques <- function(
485481
}
486482
#' @export
487483
#' @rdname cliques
488-
#' @cdocs igraph_largest_weighted_cliques
489484
largest_weighted_cliques <- function(graph, vertex.weights = NULL) {
490485
largest_weighted_cliques_impl(
491486
graph = graph,
@@ -494,7 +489,6 @@ largest_weighted_cliques <- function(graph, vertex.weights = NULL) {
494489
}
495490
#' @export
496491
#' @rdname cliques
497-
#' @cdocs igraph_weighted_clique_number
498492
weighted_clique_num <- function(graph, vertex.weights = NULL) {
499493
weighted_clique_number_impl(
500494
graph = graph,
@@ -639,8 +633,6 @@ independence_number <- ivs_size
639633

640634
#' @rdname cliques
641635
#' @export
642-
#' @cdocs igraph_maximal_cliques_hist
643-
#' @cdocs igraph_clique_size_hist
644636
clique_size_counts <- function(graph, min = 0, max = 0, maximal = FALSE) {
645637
if (maximal) {
646638
maximal_cliques_hist_impl(
@@ -669,7 +661,6 @@ clique_size_counts <- function(graph, min = 0, max = 0, maximal = FALSE) {
669661
#' @keywords graphs
670662
#' @seealso [make_full_graph()]
671663
#' @export
672-
#' @cdocs igraph_is_complete
673664
#' @examples
674665
#'
675666
#' g <- make_full_graph(6, directed = TRUE)
@@ -697,7 +688,6 @@ is_complete <- function(graph) {
697688
#' a clique.
698689
#' @keywords graphs
699690
#' @export
700-
#' @cdocs igraph_is_clique
701691
is_clique <- function(graph, candidate, directed = FALSE) {
702692
is_clique_impl(
703693
graph = graph,
@@ -714,7 +704,6 @@ is_clique <- function(graph, candidate, directed = FALSE) {
714704
#' independent set.
715705
#' @keywords graphs
716706
#' @export
717-
#' @cdocs igraph_is_independent_vertex_set
718707
is_ivs <- function(graph, candidate) {
719708
is_independent_vertex_set_impl(
720709
graph = graph,

R/coloring.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#' col <- greedy_vertex_coloring(g)
3131
#' plot(g, vertex.color = col)
3232
#'
33-
#' @cdocs igraph_vertex_coloring_greedy
3433
greedy_vertex_coloring <- function(
3534
graph,
3635
heuristic = c("colored_neighbors", "dsatur")

R/community.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3197,7 +3197,6 @@ communities <- groups.communities
31973197
#'
31983198
#' @export
31993199
#' @family functions for manipulating graph structure
3200-
#' @cdocs igraph_contract_vertices
32013200
contract <- function(
32023201
graph,
32033202
mapping,
@@ -3253,7 +3252,6 @@ contract <- function(
32533252
#'
32543253
#' @export
32553254
#' @family community
3256-
#' @cdocs igraph_voronoi
32573255
voronoi_cells <- function(
32583256
graph,
32593257
generators,

R/components.R

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ decompose <- function(
253253
#'
254254
#' @family components
255255
#' @export
256-
#' @cdocs igraph_articulation_points
257256
articulation_points <- function(graph) {
258257
articulation_points_impl(
259258
graph = graph
@@ -262,7 +261,6 @@ articulation_points <- function(graph) {
262261

263262
#' @rdname articulation_points
264263
#' @export
265-
#' @cdocs igraph_bridges
266264
bridges <- function(graph) {
267265
bridges_impl(
268266
graph = graph
@@ -317,7 +315,6 @@ bridges <- function(graph) {
317315
#' bc <- biconnected_components(g)
318316
#' @family components
319317
#' @export
320-
#' @cdocs igraph_biconnected_components
321318
biconnected_components <- function(graph) {
322319
# Function call
323320
res <- biconnected_components_impl(
@@ -389,7 +386,6 @@ biconnected_components <- function(graph) {
389386
#' is_biconnected(make_full_graph(2))
390387
#' @family components
391388
#' @export
392-
#' @cdocs igraph_is_biconnected
393389
is_biconnected <- function(graph) {
394390
is_biconnected_impl(
395391
graph = graph

0 commit comments

Comments
 (0)