11# ' Graph of friends in a social network.
22# '
3+ # ' @examples
4+ # ' \dontrun{
5+ # ' library(sparklyr)
6+ # ' sc <- spark_connect(master = "local")
7+ # ' gf_friends(sc)
8+ # ' }
39# ' @template roxlate-gf-sc
410# ' @export
511gf_friends <- function (sc ) {
@@ -14,6 +20,10 @@ gf_friends <- function(sc) {
1420# ' The vertex IDs are 0, 1, ..., n-1, and the edges are (0, 1), (1, 2), ...., (n-2, n-1).
1521# ' @template roxlate-gf-sc
1622# ' @param n Size of the graph to return.
23+ # ' @examples
24+ # ' \dontrun{
25+ # ' gf_chain(sc, 5)
26+ # ' }
1727# ' @export
1828gf_chain <- function (sc , n ) {
1929 n <- ensure_scalar_integer(n )
@@ -41,6 +51,11 @@ gf_chain <- function(sc, n) {
4151# ' "dst", and "b". Edges are directed, but they should be treated as undirected in
4252# ' any algorithms run on this model. Vertex IDs are of the form "i,j". E.g., vertex
4353# ' "1,3" is in the second row and fourth column of the grid.
54+ # '
55+ # ' @examples
56+ # ' \dontrun{
57+ # ' gf_grid_ising_model(sc, 5)
58+ # ' }
4459# ' @export
4560gf_grid_ising_model <- function (sc , n , v_std = 1 , e_std = 1 ) {
4661 sql_context <- invoke_new(sc , " org.apache.spark.sql.SQLContext" , spark_context(sc ))
@@ -59,6 +74,11 @@ gf_grid_ising_model <- function(sc, n, v_std = 1, e_std = 1) {
5974# ' indexed 0 (the root) and the n other leaf vertices 1, 2, ..., n.
6075# ' @template roxlate-gf-sc
6176# ' @param n The number of leaves.
77+ # '
78+ # ' @examples
79+ # ' \dontrun{
80+ # ' gf_star(sc, 5)
81+ # ' }
6282# ' @export
6383gf_star <- function (sc , n ) {
6484 n <- ensure_scalar_integer(n )
@@ -74,6 +94,11 @@ gf_star <- function(sc, n) {
7494# ' connected by a single edge (0->n).
7595# ' @template roxlate-gf-sc
7696# ' @param blob_size The size of each blob.
97+ # '
98+ # ' @examples
99+ # ' \dontrun{
100+ # ' gf_two_blobs(sc, 3)
101+ # ' }
77102# ' @export
78103gf_two_blobs <- function (sc , blob_size ) {
79104 blob_size <- ensure_scalar_integer(blob_size )
0 commit comments