Skip to content

Commit

Permalink
add more family tags in operators.R
Browse files Browse the repository at this point in the history
  • Loading branch information
maelle committed Feb 6, 2023
1 parent f566e65 commit 2c71a37
Show file tree
Hide file tree
Showing 22 changed files with 458 additions and 2 deletions.
20 changes: 20 additions & 0 deletions R/operators.R
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ disjoint_union <- function(...) {

#' @export
#' @rdname disjoint_union
#' @family functions for manipulating graph structure
"%du%" <- function(x, y) {
disjoint_union(x, y)
}
Expand Down Expand Up @@ -297,12 +298,14 @@ disjoint_union <- function(...) {
#' the function that implements `union()`.
#' @return Depends on the function that implements this method.
#'
#' @family functions for manipulating graph structure
#' @export
union <- function(...) {
UseMethod("union")
}

#' @method union default
#' @family functions for manipulating graph structure
#' @export
union.default <- function(...) {
base::union(...)
Expand Down Expand Up @@ -343,6 +346,7 @@ union.default <- function(...) {
#' @return A new graph object.
#' @author Gabor Csardi \email{csardi.gabor@@gmail.com}
#' @method union igraph
#' @family functions for manipulating graph structure
#' @export
#' @keywords graphs
#' @examples
Expand All @@ -361,6 +365,7 @@ union.igraph <- function(..., byname = "auto") {
)
}

#' @family functions for manipulating graph structure
#' @export
"%u%" <- function(x, y) {
union(x, y)
Expand All @@ -379,6 +384,7 @@ union.igraph <- function(..., byname = "auto") {
#' the function that implements `intersection()`.
#' @return Depends on the function that implements this method.
#'
#' @family functions for manipulating graph structure
#' @export
intersection <- function(...) {
UseMethod("intersection")
Expand Down Expand Up @@ -421,6 +427,7 @@ intersection <- function(...) {
#' @return A new graph object.
#' @author Gabor Csardi \email{csardi.gabor@@gmail.com}
#' @method intersection igraph
#' @family functions for manipulating graph structure
#' @export
#' @keywords graphs
#' @examples
Expand All @@ -440,6 +447,7 @@ intersection.igraph <- function(..., byname = "auto",
)
}

#' @family functions for manipulating graph structure
#' @export
"%s%" <- function(x, y) {
intersection(x, y)
Expand All @@ -458,6 +466,7 @@ intersection.igraph <- function(..., byname = "auto",
#' the function that implements `difference()`.
#' @return Depends on the function that implements this method.
#'
#' @family functions for manipulating graph structure
#' @export
difference <- function(...) {
UseMethod("difference")
Expand Down Expand Up @@ -496,6 +505,7 @@ difference <- function(...) {
#' @return A new graph object.
#' @author Gabor Csardi \email{csardi.gabor@@gmail.com}
#' @method difference igraph
#' @family functions for manipulating graph structure
#' @export
#' @keywords graphs
#' @examples
Expand Down Expand Up @@ -552,6 +562,7 @@ difference.igraph <- function(big, small, byname = "auto", ...) {
}
}

#' @family functions for manipulating graph structure
#' @export
"%m%" <- function(x, y) {
difference(x, y)
Expand All @@ -576,6 +587,7 @@ difference.igraph <- function(big, small, byname = "auto", ...) {
#' @param loops Logical constant, whether to generate loop edges.
#' @return A new graph object.
#' @author Gabor Csardi \email{csardi.gabor@@gmail.com}
#' @family functions for manipulating graph structure
#' @export
#' @keywords graphs
#' @examples
Expand Down Expand Up @@ -651,6 +663,7 @@ complementer <- function(graph, loops = FALSE) {
#' but not both graphs are named.
#' @return A new graph object.
#' @author Gabor Csardi \email{csardi.gabor@@gmail.com}
#' @family functions for manipulating graph structure
#' @export
#' @keywords graphs
#' @examples
Expand Down Expand Up @@ -727,6 +740,7 @@ compose <- function(g1, g2, byname = "auto") {
res
}

#' @family functions for manipulating graph structure
#' @export
"%c%" <- function(x, y) {
compose(x, y)
Expand Down Expand Up @@ -777,6 +791,7 @@ edge <- function(...) {
structure(list(...), class = "igraph.edge")
}

#' @family functions for manipulating graph structure
#' @export
#' @rdname edge
edges <- edge
Expand Down Expand Up @@ -813,6 +828,7 @@ vertex <- function(...) {
structure(list(...), class = "igraph.vertex")
}

#' @family functions for manipulating graph structure
#' @export
#' @rdname vertex
vertices <- vertex
Expand Down Expand Up @@ -1123,6 +1139,7 @@ path <- function(...) {
#' currently ignored.
#'
#' @method rep igraph
#' @family functions for manipulating graph structure
#' @export
#'
#' @examples
Expand All @@ -1142,6 +1159,7 @@ rep.igraph <- function(x, n, mark = TRUE, ...) {

#' @rdname rep.igraph
#' @method * igraph
#' @family functions for manipulating graph structure
#' @export
`*.igraph` <- function(x, n) {
if (!is_igraph(x) && is_igraph(n)) {
Expand Down Expand Up @@ -1173,11 +1191,13 @@ rep.igraph <- function(x, n, mark = TRUE, ...) {
#'
#' g <- make_graph(~ 1 -+ 2, 2 -+ 3, 3 -+ 4)
#' reverse_edges(g, 2)
#' @family functions for manipulating graph structure
#' @export
reverse_edges <- reverse_edges

#' @rdname reverse_edges
#' @param x The input graph.
#' @method t igraph
#' @family functions for manipulating graph structure
#' @export
t.igraph <- function(x) reverse_edges(x)
2 changes: 1 addition & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ reference:
- has_concept("versions")
- title: Others
- contents:
- lacks_concepts(c("adjacency", "graph attributes", "structural queries", "bipartite", "centrality", "centralization related", "cliques", "cocitation", "cohesive.blocks", "coloring", "community", "components", "console", "conversion", "deterministic constructors", "decomposition", "graphical degree sequences", "demo", "efficiency", "latent position vector samplers", "env-and-data", "epi", "eulerian", "fit", "flow", "foreign", "games", "glet", "hierarchical random graph functions", "incidence", "structural queries", "functions for manipulating graph structure", "functions for manipulating graph structure", "structural queries", "vertex and edge sequences", "vertex and edge sequence operations", "graph attributes", "graph layouts", "layout modifiers", "layout_drl", "constructor modifiers", "deterministic constructors", "minimum.spanning.tree", "graph motifs", "nexus", "functions for manipulating graph structure", "other", "palettes", "igraph options", "paths", "plot", "plot.common", "plot.shapes", "print", "printer callbacks", "random_walk", "rewiring functions", "scan statistics", "scg", "sgm", "similarity", "simple", "socnet", "structural.properties", "structural queries", "test", "tkplot", "graph isomorphism", "trees", "triangles", "versions"))
- lacks_concepts(c("adjacency", "graph automorphism", "structural queries", "bipartite", "centrality", "centralization related", "cliques", "cocitation", "cohesive.blocks", "coloring", "community", "components", "console", "conversion", "deterministic constructors", "decomposition", "graphical degree sequences", "demo", "efficiency", "latent position vector samplers", "env-and-data", "epi", "eulerian", "fit", "flow", "foreign", "games", "glet", "hierarchical random graph functions", "incidence", "structural queries", "functions for manipulating graph structure", "functions for manipulating graph structure", "structural queries", "vertex and edge sequences", "vertex and edge sequence operations", "graph attributes", "graph layouts", "layout modifiers", "layout_drl", "constructor modifiers", "deterministic constructors", "minimum.spanning.tree", "graph motifs", "nexus", "functions for manipulating graph structure", "other", "palettes", "igraph options", "paths", "plot", "plot.common", "plot.shapes", "print", "printer callbacks", "random_walk", "rewiring functions", "scan statistics", "scg", "sgm", "similarity", "simple", "socnet", "structural.properties", "structural queries", "test", "tkplot", "graph isomorphism", "trees", "triangles", "versions"))
- title: internal
- contents:
- has_concept("nexus")
11 changes: 11 additions & 0 deletions man/add_edges.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions man/add_vertices.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions man/complementer.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions man/compose.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions man/delete_edges.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions man/delete_vertices.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions man/difference.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions man/difference.igraph.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2c71a37

Please sign in to comment.