Skip to content

Commit

Permalink
fix %\>% typo in vignettes (#1343)
Browse files Browse the repository at this point in the history
  • Loading branch information
aviator-app[bot] authored May 20, 2024
2 parents e7ea747 + 385b704 commit fc168c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions vignettes/igraph.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ If you try to add edges to vertices with invalid IDs (i.e., you try to add an ed
g <- add_edges(g, edges = c(38, 37))
```

Let us add some more vertices and edges to our graph. In `igraph` we can use the `magrittr` package, which provides a mechanism for chaining commands with the operator `%\>%`:
Let us add some more vertices and edges to our graph. In `igraph` we can use the `magrittr` package, which provides a mechanism for chaining commands with the operator `%>%`:

```{r echo = TRUE}
g <- g %>%
Expand Down Expand Up @@ -252,7 +252,7 @@ g <- make_graph(
)
```

Each vertex represents a person, so we want to store ages, genders and types of connection between two people (`is_formal()` refers to whether a connection between one person or another is formal or informal, respectively colleagues or friends). The `\$` operator is a shortcut to get and set graph attributes. It is shorter and just as readable as `graph_attr()` and `set_graph_attr()`.
Each vertex represents a person, so we want to store ages, genders and types of connection between two people (`is_formal()` refers to whether a connection between one person or another is formal or informal, respectively colleagues or friends). The `$` operator is a shortcut to get and set graph attributes. It is shorter and just as readable as `graph_attr()` and `set_graph_attr()`.

```{r echo = TRUE}
V(g)$age <- c(25, 31, 18, 23, 47, 22, 50)
Expand All @@ -261,7 +261,7 @@ E(g)$is_formal <- c(FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE)
summary(g)
```

`V()` and `E()` are the standard way to obtain a sequence of all vertices and edges, respectively. This assigns an attribute to *all* vertices/edges at once. Another way to generate our social network is with the use of `set_vertex_attr()` and `set_edge_attr()` and the operator `%\>%`:
`V()` and `E()` are the standard way to obtain a sequence of all vertices and edges, respectively. This assigns an attribute to *all* vertices/edges at once. Another way to generate our social network is with the use of `set_vertex_attr()` and `set_edge_attr()` and the operator `%>%`:

```{r echo = TRUE, eval=FALSE}
g <- make_graph(
Expand Down
4 changes: 2 additions & 2 deletions vignettes/igraph_ES.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Si intentas añadir aristas a vértices con IDs no válidos (por ejemplo, intent
g <- add_edges(g, edges = c(38, 37))
```

Añadamos más vértices y aristas a nuestro grafo. En `igraph` podemos utilizar el paquete `magrittr`, que proporciona un mecanismo para encadenar comandos con el operador `%\>%`:
Añadamos más vértices y aristas a nuestro grafo. En `igraph` podemos utilizar el paquete `magrittr`, que proporciona un mecanismo para encadenar comandos con el operador `%>%`:

```{r echo = TRUE}
g <- g %>%
Expand Down Expand Up @@ -271,7 +271,7 @@ E(g)$is_formal <- c(FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE)
summary(g)
```

`V` y `E` son la forma estándar de obtener una secuencia de todos los vértices y aristas respectivamente. Esto asigna un atributo a *todos* los vértices/aristas a la vez. Otra forma de generar nuestra red social es con el uso de `set_vertex_attr()` y `set_edge_attr()` y el operador `%\>%`:
`V` y `E` son la forma estándar de obtener una secuencia de todos los vértices y aristas respectivamente. Esto asigna un atributo a *todos* los vértices/aristas a la vez. Otra forma de generar nuestra red social es con el uso de `set_vertex_attr()` y `set_edge_attr()` y el operador `%>%`:

```{r echo = TRUE, eval=FALSE}
g <- make_graph(
Expand Down

0 comments on commit fc168c6

Please sign in to comment.