The igraph documentation is generally quite detailed for each function, once the correct function is found. Over time, as function names have been made more consistent, the large number of available functions (around 800, I believe) has made finding the right one a bit challenging.
It seems that there is an underlying rationale for how the "canonical" name for a given function is constructed. For graph constructors, for example, I have come across three main types, sample_*, make_* and graph_from_* (see a reprex below). However, I have not been able to locate documentation outlining these categories (or categories for other types of functions). I wonder if such documentation exists.
If it does, this feature request would be to make it more prominent through the help or on the web site. If not, could it be created? It would not have to be long, basically a list of prefixes, the role that functions with a given prefix play, and perhaps a list of the functions with that prefix.
library(igraph, warn.conflicts=FALSE)
ls("package:igraph") %>% stringr::str_subset("^sample_.|^make_.|^graph_from_.")
#> [1] "graph_from_adj_list" "graph_from_adjacency_matrix"
#> [3] "graph_from_atlas" "graph_from_data_frame"
#> [5] "graph_from_edgelist" "graph_from_graphdb"
#> [7] "graph_from_graphnel" "graph_from_incidence_matrix"
#> [9] "graph_from_isomorphism_class" "graph_from_lcf"
#> [11] "graph_from_literal" "make_bipartite_graph"
#> [13] "make_chordal_ring" "make_clusters"
#> [15] "make_de_bruijn_graph" "make_directed_graph"
#> [17] "make_ego_graph" "make_empty_graph"
#> [19] "make_full_bipartite_graph" "make_full_citation_graph"
#> [21] "make_full_graph" "make_graph"
#> [23] "make_kautz_graph" "make_lattice"
#> [25] "make_line_graph" "make_ring"
#> [27] "make_star" "make_tree"
#> [29] "make_undirected_graph" "sample_asym_pref"
#> [31] "sample_bipartite" "sample_cit_cit_types"
#> [33] "sample_cit_types" "sample_correlated_gnp"
#> [35] "sample_correlated_gnp_pair" "sample_degseq"
#> [37] "sample_dirichlet" "sample_dot_product"
#> [39] "sample_fitness" "sample_fitness_pl"
#> [41] "sample_forestfire" "sample_gnm"
#> [43] "sample_gnp" "sample_grg"
#> [45] "sample_growing" "sample_hierarchical_sbm"
#> [47] "sample_hrg" "sample_islands"
#> [49] "sample_k_regular" "sample_last_cit"
#> [51] "sample_motifs" "sample_pa"
#> [53] "sample_pa_age" "sample_pref"
#> [55] "sample_sbm" "sample_seq"
#> [57] "sample_smallworld" "sample_sphere_surface"
#> [59] "sample_sphere_volume" "sample_traits"
#> [61] "sample_traits_callaway"
The
igraphdocumentation is generally quite detailed for each function, once the correct function is found. Over time, as function names have been made more consistent, the large number of available functions (around 800, I believe) has made finding the right one a bit challenging.It seems that there is an underlying rationale for how the "canonical" name for a given function is constructed. For graph constructors, for example, I have come across three main types,
sample_*,make_*andgraph_from_*(see a reprex below). However, I have not been able to locate documentation outlining these categories (or categories for other types of functions). I wonder if such documentation exists.If it does, this feature request would be to make it more prominent through the help or on the web site. If not, could it be created? It would not have to be long, basically a list of prefixes, the role that functions with a given prefix play, and perhaps a list of the functions with that prefix.