Skip to content

Commit

Permalink
precompile Vignettes and README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Anka authored and Anka committed Sep 2, 2024
1 parent 57bf431 commit c0f2875
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 20 deletions.
Binary file modified vignettes/teaching/plot-teaching2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions vignettes/teaching1.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ library(ggraph)
library(migraph)
# The network at the beginning
callNetworkBgn <- as.matrix(callNetwork)
autographr(callNetworkBgn, labels = FALSE, layout = "fr")
graphr(callNetworkBgn, labels = FALSE, layout = "fr")

# The network at half time
callNetworkHlf <- as.matrix(
Expand All @@ -108,15 +108,15 @@ callNetworkHlf <- as.matrix(
as_igraph() |>
add_node_attribute("floor", actors$floor)

autographr(callNetworkHlf, labels = FALSE, layout = "fr") +
graphr(callNetworkHlf, labels = FALSE, layout = "fr") +
geom_node_point(aes(color = as.factor(floor)), size = 2, show.legend = FALSE)

# The network at the end
callNetworkEnd <- as.matrix(callNetwork, time = max(calls$time) + 1) |>
as_igraph() |>
add_node_attribute("floor", actors$floor)

autographr(callNetworkEnd, labels = FALSE, layout = "fr") +
graphr(callNetworkEnd, labels = FALSE, layout = "fr") +
geom_node_point(aes(color = as.factor(floor)), size = 2, show.legend = FALSE)


Expand Down
6 changes: 3 additions & 3 deletions vignettes/teaching1.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ library(ggraph)
library(migraph)
# The network at the beginning
callNetworkBgn <- as.matrix(callNetwork)
autographr(callNetworkBgn, labels = FALSE, layout = "fr")
graphr(callNetworkBgn, labels = FALSE, layout = "fr")
```

![plot of chunk plot-teaching1](teaching/plot-teaching1-1.png)
Expand All @@ -379,7 +379,7 @@ callNetworkHlf <- as.matrix(
as_igraph() |>
add_node_attribute("floor", actors$floor)

autographr(callNetworkHlf, labels = FALSE, layout = "fr") +
graphr(callNetworkHlf, labels = FALSE, layout = "fr") +
geom_node_point(aes(color = as.factor(floor)), size = 2, show.legend = FALSE)
```

Expand All @@ -392,7 +392,7 @@ callNetworkEnd <- as.matrix(callNetwork, time = max(calls$time) + 1) |>
as_igraph() |>
add_node_attribute("floor", actors$floor)

autographr(callNetworkEnd, labels = FALSE, layout = "fr") +
graphr(callNetworkEnd, labels = FALSE, layout = "fr") +
geom_node_point(aes(color = as.factor(floor)), size = 2, show.legend = FALSE)
```

Expand Down
6 changes: 3 additions & 3 deletions vignettes/teaching2.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ endNet <- as.matrix(bilatnet, time = as.numeric(as.POSIXct("1970-01-01"))) |>
add_node_attribute("gdp", endStates$gdp)

# logical value indicating if states where present and with agreements
isStateActiveStart <- startStates$present & node_degree(startNet) > 0
isStateActiveEnd <- endStates$present & node_degree(endNet) > 0
isStateActiveStart <- startStates$present & node_deg(startNet) > 0
isStateActiveEnd <- endStates$present & node_deg(endNet) > 0
isStateActive <- isStateActiveStart | isStateActiveEnd

# subset networks to active states
startNet <- delete_nodes(startNet, !isStateActive)
endNet <- delete_nodes(endNet, !isStateActive)

autographs(list(startNet, endNet), layout = "fr")
graphs(list(startNet, endNet), layout = "fr")


## ----hlp-effects, eval=FALSE--------------------------------------------------
Expand Down
16 changes: 5 additions & 11 deletions vignettes/teaching2.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -399,21 +399,15 @@ endNet <- as.matrix(bilatnet, time = as.numeric(as.POSIXct("1970-01-01"))) |>
add_node_attribute("gdp", endStates$gdp)

# logical value indicating if states where present and with agreements
isStateActiveStart <- startStates$present & node_degree(startNet) > 0
isStateActiveEnd <- endStates$present & node_degree(endNet) > 0
isStateActiveStart <- startStates$present & node_deg(startNet) > 0
isStateActiveEnd <- endStates$present & node_deg(endNet) > 0
isStateActive <- isStateActiveStart | isStateActiveEnd

# subset networks to active states
startNet <- delete_nodes(startNet, !isStateActive)
#> Error in as_igraph_vs(graph, v): Invalid vertex name(s)
endNet <- delete_nodes(endNet, !isStateActive)
#> Error in as_igraph_vs(graph, v): Invalid vertex name(s)

autographs(list(startNet, endNet), layout = "fr")
#> The patchwork package is required to run this function. Would you like to install patchwork from CRAN? (Yes/no/cancel)
#>
#> The downloaded binary packages are in
#> /var/folders/m4/5dz5h26x329cqq4fx333f8gm0000gn/T//RtmpzFJfKh/downloaded_packages
graphs(list(startNet, endNet), layout = "fr")
```

<div class="figure" style="text-align: center">
Expand Down Expand Up @@ -472,7 +466,7 @@ system.time(
#> Warning: engine = "gather_compute" doesn't support ignoreRep effects. engine
#> ="default" is used instead.
#> user system elapsed
#> 59.171 2.362 61.570
#> 62.352 2.947 65.340
```

Did the model converge? If not, you can restart the estimation process using
Expand Down Expand Up @@ -566,7 +560,7 @@ system.time(
)
)
#> user system elapsed
#> 31.179 0.271 31.456
#> 34.706 0.374 35.115
```

# Extensions...
Expand Down

0 comments on commit c0f2875

Please sign in to comment.