diff --git a/.Rbuildignore b/.Rbuildignore index 8c7d3b2..0a707e2 100755 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -31,3 +31,5 @@ README[.]md makefile ^src/Makevars$ ^docs$ +^LICENSE\.md$ +^_pkgdown\.yml$ diff --git a/DESCRIPTION b/DESCRIPTION index 8f7b0ce..f186772 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -6,9 +6,10 @@ Authors@R: c( person("George", "Vega Yon", email="g.vegayon@gmail.com", role=c("aut", "cre"), comment=c(ORCID = "0000-0002-3171-0844", what="Rewrite functions with Rcpp, plus new features") ), + person("Thomas", "Valente", email="tvalente@usc.edu", role=c("aut", "cph"), comment="R original code"), person("Stephanie", "Dyal", email="stepharp@usc.edu", role=c("ctb"), comment="Package's first version"), - person("Timothy", "Hayes", email="timothybhayes@gmail.com", role=c("ctb"), comment="Package's first version"), - person("Thomas", "Valente", email="tvalente@usc.edu", role=c("aut", "cph"), comment="R original code")) + person("Timothy", "Hayes", email="timothybhayes@gmail.com", role=c("ctb"), comment="Package's first version") + ) Description: Empirical statistical analysis, visualization and simulation of diffusion and contagion processes on networks. The package implements algorithms for calculating network diffusion statistics such as transmission rate, hazard @@ -47,9 +48,10 @@ Suggests: survival VignetteBuilder: knitr LinkingTo: Rcpp, RcppArmadillo -RoxygenNote: 6.0.1.9000 +RoxygenNote: 6.0.1 Encoding: UTF-8 -URL: https://github.com/USCCANA/netdiffuseR +URL: https://github.com/USCCANA/netdiffuseR, + https://USCCANA.github.io/netdiffuseR BugReports: https://github.com/USCCANA/netdiffuseR/issues Classification/MSC: 90C35, 90B18, 91D30 Collate: diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..d9bbfe3 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +# MIT License + +Copyright (c) 2018 Thomas W. Valente + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.Rmd b/README.Rmd index 548cc1e..1fef067 100644 --- a/README.Rmd +++ b/README.Rmd @@ -9,6 +9,7 @@ output: github_document [](http://cran.rstudio.com/web/packages/netdiffuseR/index.html) [](http://cran.r-project.org/package=netdiffuseR) [](http://cran.rstudio.com/web/packages/netdiffuseR/index.html) +[](https://doi.org/10.5281/zenodo.1039317) This package contains functions useful for analyzing network data for diffusion of innovations applications. diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 0000000..e69de29 diff --git a/docs/LICENSE.html b/docs/LICENSE.html new file mode 100644 index 0000000..34d4f64 --- /dev/null +++ b/docs/LICENSE.html @@ -0,0 +1,153 @@ + + + +
+ + + + +Copyright (c) 2018 Thomas W. Valente
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+rdiffnet
function • netdiffuseR# Creating a random diffnet object set.seed(84117) -mydiffnet <- rdiffnet(30, 5) +mydiffnet <- rdiffnet(30, 5) # Coercing it into an array as.array(mydiffnet)#> , , 1 diff --git a/docs/reference/bass-1.png b/docs/reference/bass-1.png index 2820f88..6d3b8e2 100644 Binary files a/docs/reference/bass-1.png and b/docs/reference/bass-1.png differ diff --git a/docs/reference/bass.html b/docs/reference/bass.html index 13426ae..9427199 100644 --- a/docs/reference/bass.html +++ b/docs/reference/bass.html @@ -267,11 +267,11 @@See a
+Other statistics:
classify_adopters
,cumulative_adopt_count
,dgr
, -ego_variance
,exposure
, +ego_variance
,exposure
,hazard_rate
,infection
,moran
,struct_equiv
,threshold
, -vertex_covariate_dist
vertex_covariate_dist
Examples
diff --git a/docs/reference/bootnet.html b/docs/reference/bootnet.html index 1628a19..e1dc58a 100644 --- a/docs/reference/bootnet.html +++ b/docs/reference/bootnet.html @@ -270,13 +270,13 @@R
See also
+Other Functions for inference:
moran
, -struct_test
struct_test
Examples
# set.seed(13) -g <- rgraph_ba(t=99) +g <- rgraph_ba(t=99) ans <- bootnet(g, function(w, ...) length(w@x), R=100) ans#> diff --git a/docs/reference/c.diffnet.html b/docs/reference/c.diffnet.html index 2db35e2..5995b6c 100644 --- a/docs/reference/c.diffnet.html +++ b/docs/reference/c.diffnet.html @@ -190,10 +190,10 @@Examp city4 <- medInnovationsDiffNet[medInnovationsDiffNet[["city"]] == 4] # Computing exposure in each one -city1[["expo_se"]] <- exposure(city1, alt.graph="se", valued=TRUE) -city2[["expo_se"]] <- exposure(city2, alt.graph="se", valued=TRUE) -city3[["expo_se"]] <- exposure(city3, alt.graph="se", valued=TRUE) -city4[["expo_se"]] <- exposure(city4, alt.graph="se", valued=TRUE) +city1[["expo_se"]] <- exposure(city1, alt.graph="se", valued=TRUE) +city2[["expo_se"]] <- exposure(city2, alt.graph="se", valued=TRUE) +city3[["expo_se"]] <- exposure(city3, alt.graph="se", valued=TRUE) +city4[["expo_se"]] <- exposure(city4, alt.graph="se", valued=TRUE) # Concatenating all diffnet <- c(city1, city2, city3, city4) diff --git a/docs/reference/classify_adopters-1.png b/docs/reference/classify_adopters-1.png index 6d15df7..2aa34e0 100644 Binary files a/docs/reference/classify_adopters-1.png and b/docs/reference/classify_adopters-1.png differ diff --git a/docs/reference/classify_adopters.html b/docs/reference/classify_adopters.html index 29f0506..9a26b45 100644 --- a/docs/reference/classify_adopters.html +++ b/docs/reference/classify_adopters.html @@ -264,11 +264,11 @@
See a
+Other statistics:
bass
,cumulative_adopt_count
,dgr
, -ego_variance
,exposure
, +ego_variance
,exposure
,hazard_rate
,infection
,moran
,struct_equiv
,threshold
, -vertex_covariate_dist
vertex_covariate_dist
Examples
diff --git a/docs/reference/cumulative_adopt_count.html b/docs/reference/cumulative_adopt_count.html index 632484f..5f50340 100644 --- a/docs/reference/cumulative_adopt_count.html +++ b/docs/reference/cumulative_adopt_count.html @@ -163,11 +163,11 @@See a
+Other statistics:
bass
,classify_adopters
,dgr
, -ego_variance
,exposure
, +ego_variance
,exposure
,hazard_rate
,infection
,moran
,struct_equiv
,threshold
, -vertex_covariate_dist
vertex_covariate_dist
diff --git a/docs/reference/dgr-1.png b/docs/reference/dgr-1.png index c7d983c..7dfc094 100644 Binary files a/docs/reference/dgr-1.png and b/docs/reference/dgr-1.png differ diff --git a/docs/reference/dgr-2.png b/docs/reference/dgr-2.png index 3560b9b..521335d 100644 Binary files a/docs/reference/dgr-2.png and b/docs/reference/dgr-2.png differ diff --git a/docs/reference/dgr.html b/docs/reference/dgr.html index 78f3d0e..c6122b7 100644 --- a/docs/reference/dgr.html +++ b/docs/reference/dgr.html @@ -218,11 +218,11 @@See a
Other statistics:
+bass
,classify_adopters
,cumulative_adopt_count
, -ego_variance
,exposure
, +ego_variance
,exposure
,hazard_rate
,infection
,moran
,struct_equiv
,threshold
, -vertex_covariate_dist
vertex_covariate_dist
Other visualizations:
diffusionMap
,drawColorKey
,grid_distribution
, @@ -237,7 +237,7 @@Examp
# Comparing degree measurements --------------------------------------------- # Creating an undirected graph -graph <- rgraph_ba() +graph <- rgraph_ba() graph#> 11 x 11 sparse Matrix of class "dgCMatrix"#>#> #> 1 1 . . . . . . . . . . #> 2 . 1 . . . . . . . . . @@ -274,7 +274,7 @@Examp any(d_valued!=d_unvalued)
#> [1] TRUE# Classic Scale-free plot --------------------------------------------------- set.seed(1122) -g <- rgraph_ba(t=1e3-1) +g <- rgraph_ba(t=1e3-1) hist(dgr(g))# Since by default uses logscale, here we suppress the warnings # on points been discarded for <=0. diff --git a/docs/reference/diffnet-arithmetic-1.png b/docs/reference/diffnet-arithmetic-1.png index 52726c1..b395073 100644 Binary files a/docs/reference/diffnet-arithmetic-1.png and b/docs/reference/diffnet-arithmetic-1.png differ diff --git a/docs/reference/diffnet-class-1.png b/docs/reference/diffnet-class-1.png index 12919d6..6b89f88 100644 Binary files a/docs/reference/diffnet-class-1.png and b/docs/reference/diffnet-class-1.png differ diff --git a/docs/reference/diffnet-class.html b/docs/reference/diffnet-class.html index aade60b..ddc9b57 100644 --- a/docs/reference/diffnet-class.html +++ b/docs/reference/diffnet-class.html @@ -388,7 +388,7 @@Examp
# Creating a random graph set.seed(123) -graph <- rgraph_ba(t=9) +graph <- rgraph_ba(t=9) graph <- lapply(1:5, function(x) graph) # Pretty TOA diff --git a/docs/reference/diffnet_index.html b/docs/reference/diffnet_index.html index 975ad9f..c589cca 100644 --- a/docs/reference/diffnet_index.html +++ b/docs/reference/diffnet_index.html @@ -248,7 +248,7 @@Examp
# Creating a random diffusion network --------------------------------------- set.seed(111) -graph <- rdiffnet(100,5) +graph <- rdiffnet(100,5) # Accessing to a static attribute graph[["real_threshold"]]#> [1] 0.62034522 0.54853665 0.84659582 0.03114472 0.07245070 0.41045318 @@ -721,10 +721,10 @@diff --git a/docs/reference/egonet_attrs.html b/docs/reference/egonet_attrs.html index 092e04f..a3823b8 100644 --- a/docs/reference/egonet_attrs.html +++ b/docs/reference/egonet_attrs.html @@ -252,7 +252,7 @@Examp # Adding attributes (dynamic) ----------------------------------------------- # Preparing the data set.seed(1122) -x <- rdiffnet(30, 5, seed.p.adopt=.15) +x <- rdiffnet(30, 5, seed.p.adopt=.15) # Calculating exposure, and storing it diffe -expoM <- exposure(x) +expoM <- exposure(x) expoL <- lapply(seq_len(x$meta$nper), function(x) expoM[,x,drop=FALSE]) expoD <- do.call(rbind, expoL) diff --git a/docs/reference/diffnetmatmult.html b/docs/reference/diffnetmatmult.html index 079e738..45c92e8 100644 --- a/docs/reference/diffnetmatmult.html +++ b/docs/reference/diffnetmatmult.html @@ -184,7 +184,7 @@
Examp # Random diffnet graph set.seed(773) -net <- rdiffnet(100, 4, seed.graph='small-world', rgraph.args=list(k=8)) +net <- rdiffnet(100, 4, seed.graph='small-world', rgraph.args=list(k=8)) netsim <- net # According to Dekker (2006), Simmelian ties can be computed as follows diff --git a/docs/reference/diffusionMap.html b/docs/reference/diffusionMap.html index 29fccba..b1beee7 100644 --- a/docs/reference/diffusionMap.html +++ b/docs/reference/diffusionMap.html @@ -264,7 +264,7 @@
Examp set.seed(1231) # Random scale-free diffusion network -x <- rdiffnet(1000, 4, seed.graph="scale-free", seed.p.adopt = .025, +x <- rdiffnet(1000, 4, seed.graph="scale-free", seed.p.adopt = .025, rewire = FALSE, seed.nodes = "central", rgraph.arg=list(self=FALSE, m=4), threshold.dist = function(id) runif(1,.2,.4)) diff --git a/docs/reference/drawColorKey-1.png b/docs/reference/drawColorKey-1.png index cf96666..4fe03db 100644 Binary files a/docs/reference/drawColorKey-1.png and b/docs/reference/drawColorKey-1.png differ diff --git a/docs/reference/edgelist_to_adjmat-1.png b/docs/reference/edgelist_to_adjmat-1.png index 6fa24d1..a38f155 100644 Binary files a/docs/reference/edgelist_to_adjmat-1.png and b/docs/reference/edgelist_to_adjmat-1.png differ diff --git a/docs/reference/edges_coords-2.png b/docs/reference/edges_coords-2.png index 051f13f..317f94a 100644 Binary files a/docs/reference/edges_coords-2.png and b/docs/reference/edges_coords-2.png differ diff --git a/docs/reference/ego_variance.html b/docs/reference/ego_variance.html index b5a0e88..353a31a 100644 --- a/docs/reference/ego_variance.html +++ b/docs/reference/ego_variance.html @@ -170,21 +170,21 @@
Details the function specified in
funname
, and, ifall=FALSE
\(f_i = \sum_j a_{ij}f(y_i,y_j)^2/\sum_ja_{ij}\), otherwise \(f_i = f_j = \frac{1}{n^2}\sum_{i,j}f(y_i,y_j)\) -This is an auxiliary function for
struct_test
. The idea is +This is an auxiliary function for
struct_test
. The idea is to compute an adjusted measure of disimilarity between vertices, so the closest in terms of \(f\) is \(i\) to its neighbors, the smaller the relative variance.See also
-++
struct_test
Other statistics:
bass
,classify_adopters
,cumulative_adopt_count
,dgr
, -exposure
,hazard_rate
, +exposure
,hazard_rate
,infection
,moran
,struct_equiv
,threshold
, -vertex_covariate_dist
vertex_covariate_dist
See a
Examples
# Simple example with diffnet ----------------------------------------------- set.seed(1001) -diffnet <- rdiffnet(150, 5, seed.graph="small-world") +diffnet <- rdiffnet(150, 5, seed.graph="small-world") # Adding attributes indeg <- dgr(diffnet, cmode="indegree") diff --git a/docs/reference/exposure.html b/docs/reference/exposure.html index aa8ca23..5ccee9b 100644 --- a/docs/reference/exposure.html +++ b/docs/reference/exposure.html @@ -250,7 +250,7 @@+Details
If
+found at the examples section of the functionnormalize=FALSE
then denominator, \(S_t \times x_t\), is not included. This can be useful when, for example, exposure needs to be computed as a count instead of a proportion. A good example of this can be -found at the examples section of the functionrdiffnet
.rdiffnet
.References
@@ -268,14 +268,14 @@See a
ego_variance
,hazard_rate
,infection
,moran
,struct_equiv
,threshold
, -vertex_covariate_dist
vertex_covariate_dist
Examples
# Calculating lagged exposure ----------------------------------------------- set.seed(8) -graph <- rdiffnet(20, 4) +graph <- rdiffnet(20, 4) expo0 <- exposure(graph) expo1 <- exposure(graph, lags = 1) @@ -286,7 +286,7 @@Examp # Calculating the exposure based on Structural Equivalence ------------------ set.seed(113132) -graph <- rdiffnet(100, 10) +graph <- rdiffnet(100, 10) SE <- lapply(struct_equiv(graph), "[[", "SE") SE <- lapply(SE, function(x) { diff --git a/docs/reference/hazard_rate-1.png b/docs/reference/hazard_rate-1.png index ca6e12b..78d7356 100644 Binary files a/docs/reference/hazard_rate-1.png and b/docs/reference/hazard_rate-1.png differ diff --git a/docs/reference/hazard_rate.html b/docs/reference/hazard_rate.html index 1f27129..d86f403 100644 --- a/docs/reference/hazard_rate.html +++ b/docs/reference/hazard_rate.html @@ -258,10 +258,10 @@
See a
+Other statistics:
+bass
,classify_adopters
,cumulative_adopt_count
,dgr
, -ego_variance
,exposure
, +ego_variance
,exposure
,infection
,moran
,struct_equiv
,threshold
, -vertex_covariate_dist
vertex_covariate_dist
Other visualizations:
dgr
,diffusionMap
,drawColorKey
,grid_distribution
, diff --git a/docs/reference/infection.html b/docs/reference/infection.html index 6ac6126..fbe9f05 100644 --- a/docs/reference/infection.html +++ b/docs/reference/infection.html @@ -247,10 +247,10 @@See a
Other statistics:
bass
,classify_adopters
,cumulative_adopt_count
,dgr
, -ego_variance
,exposure
, +ego_variance
,exposure
,hazard_rate
,moran
,struct_equiv
,threshold
, -vertex_covariate_dist
vertex_covariate_dist
Examples
diff --git a/docs/reference/matrix_compare.html b/docs/reference/matrix_compare.html index f6daf0f..c283009 100644 --- a/docs/reference/matrix_compare.html +++ b/docs/reference/matrix_compare.html @@ -188,7 +188,7 @@Details
See also
+Other dyadic-level comparison functions:
vertex_covariate_compare
, -vertex_covariate_dist
vertex_covariate_dist
Examples
@@ -196,8 +196,8 @@Examp # Creating two random matrices set.seed(89) -A <- rgraph_ba(t = 9, m = 4) -B <- rgraph_ba(t = 9, m = 4) +A <- rgraph_ba(t = 9, m = 4) +B <- rgraph_ba(t = 9, m = 4) A;B
#> 10 x 10 sparse Matrix of class "dgCMatrix"#>#> #> 1 1 . . . . . . . . . #> 2 1 . . . . . . . . . @@ -232,8 +232,8 @@# NOT RUN { set.seed(123123123) -A <- rgraph_ba(t = 5e3, m = 2) -B <- rgraph_ba(t = 5e3, m = 2) +A <- rgraph_ba(t = 5e3, m = 2) +B <- rgraph_ba(t = 5e3, m = 2) Am <- as.matrix(A) Bm <- as.matrix(B) @@ -241,7 +241,7 @@Examp # More elaborated example (speed) -------------------------------------------
Examp compfun <- function(a,b) ifelse(a > b, a, b) -microbenchmark::microbenchmark( +microbenchmark::microbenchmark( diffnet = matrix_compare(A, B, compfun), R = matrix(ifelse(Am > Bm, Am, Bm), ncol=ncol(Am)), times = 10 diff --git a/docs/reference/mentor_matching-1.png b/docs/reference/mentor_matching-1.png index ad4184a..7183107 100644 Binary files a/docs/reference/mentor_matching-1.png and b/docs/reference/mentor_matching-1.png differ diff --git a/docs/reference/moran.html b/docs/reference/moran.html index 4fb2b92..581a028 100644 --- a/docs/reference/moran.html +++ b/docs/reference/moran.html @@ -190,12 +190,12 @@
See a
+Other statistics:
-bass
,classify_adopters
,cumulative_adopt_count
,dgr
, -ego_variance
,exposure
, +ego_variance
,exposure
,hazard_rate
,infection
,struct_equiv
,threshold
, -vertex_covariate_dist
Other Functions for inference:
bootnet
, -struct_test
vertex_covariate_dist
+Other Functions for inference:
bootnet
, +struct_test
Examples
@@ -203,7 +203,7 @@Examp # NOT RUN { # Generating a small random graph set.seed(123) - graph <- rgraph_ba(t = 4) + graph <- rgraph_ba(t = 4) w <- approx_geodesic(graph) x <- rnorm(5) diff --git a/docs/reference/netmatch.html b/docs/reference/netmatch.html index 0d8bcbe..6c4441d 100644 --- a/docs/reference/netmatch.html +++ b/docs/reference/netmatch.html @@ -21,9 +21,11 @@ + + + - @@ -38,6 +40,7 @@ + @@ -62,7 +65,7 @@ diff --git a/docs/reference/network.html b/docs/reference/network.html index c9436fa..f00b1c7 100644 --- a/docs/reference/network.html +++ b/docs/reference/network.html @@ -21,9 +21,11 @@ + + + - @@ -34,6 +36,7 @@ + @@ -58,7 +61,7 @@ @@ -222,7 +225,7 @@
See a
Examples
# Cohersing a diffnet to a list of networks --------------------------------- set.seed(1) -ans <- diffnet_to_network(rdiffnet(20, 2)) +ans <- diffnet_to_network(rdiffnet(20, 2)) ans# A random diffusion network ------------------------------------------------ set.seed(87) -dn <- rdiffnet(50, 4) +dn <- rdiffnet(50, 4) ans <- diffnet_to_networkDynamic(dn)#> Argument base.net not specified, using first element of network.list instead #> Created net.obs.period to describe network #> Network observation period info: diff --git a/docs/reference/nvertices.html b/docs/reference/nvertices.html index 30145ad..bdc0a61 100644 --- a/docs/reference/nvertices.html +++ b/docs/reference/nvertices.html @@ -21,9 +21,11 @@ + + + - @@ -34,6 +36,7 @@ + @@ -58,7 +61,7 @@@@ -165,7 +168,7 @@Details
Examples
# Creating a dynamic graph (we will use this for all the classes) ----------- set.seed(13133) -diffnet <- rdiffnet(100, 4) +diffnet <- rdiffnet(100, 4) # Lets use the first time period as a static graph graph_mat <- diffnet$graph[[1]] diff --git a/docs/reference/permute_graph.html b/docs/reference/permute_graph.html index f0b8c5c..b583f6c 100644 --- a/docs/reference/permute_graph.html +++ b/docs/reference/permute_graph.html @@ -21,9 +21,11 @@ + + + - @@ -37,6 +39,7 @@ + @@ -61,7 +64,7 @@@@ -174,8 +177,8 @@R
See also
@@ -183,7 +186,7 @@This function can be used as null distribution in
-struct_test
Other simulation functions:
rdiffnet
, -rewire_graph
,rgraph_ba
, +Other simulation functions:
rdiffnet
, +rewire_graph
,rgraph_ba
,rgraph_er
,rgraph_ws
,ring_lattice
See a
Examples
+ color.palette = viridis::viridis_pal(), include.grid = TRUE, + exclude.zeros = FALSE, valued = getOption("diffnet.valued", FALSE), ...)# Simple example ------------------------------------------------------------ set.seed(1231) -g <- rgraph_ba(t=9) +g <- rgraph_ba(t=9) g#> 10 x 10 sparse Matrix of class "dgCMatrix"#>#> #> 1 1 . . . . . . . . . #> 2 1 . . . . . . . . . diff --git a/docs/reference/plot.diffnet-1.png b/docs/reference/plot.diffnet-1.png index 3b838c5..911505a 100644 Binary files a/docs/reference/plot.diffnet-1.png and b/docs/reference/plot.diffnet-1.png differ diff --git a/docs/reference/plot.diffnet.html b/docs/reference/plot.diffnet.html index 22e78b2..4d791ba 100644 --- a/docs/reference/plot.diffnet.html +++ b/docs/reference/plot.diffnet.html @@ -21,9 +21,11 @@ + + + - @@ -34,6 +36,7 @@ + @@ -58,7 +61,7 @@diff --git a/docs/reference/plot_adopters-1.png b/docs/reference/plot_adopters-1.png index 8e33850..22c313c 100644 Binary files a/docs/reference/plot_adopters-1.png and b/docs/reference/plot_adopters-1.png differ diff --git a/docs/reference/plot_adopters-2.png b/docs/reference/plot_adopters-2.png index c52b9ad..c076d53 100644 Binary files a/docs/reference/plot_adopters-2.png and b/docs/reference/plot_adopters-2.png differ diff --git a/docs/reference/plot_adopters.html b/docs/reference/plot_adopters.html index 25c5c57..338ce31 100644 --- a/docs/reference/plot_adopters.html +++ b/docs/reference/plot_adopters.html @@ -21,9 +21,11 @@ + + + - @@ -34,6 +36,7 @@ + @@ -58,7 +61,7 @@ @@ -224,7 +227,7 @@See a
Examples
diff --git a/docs/reference/plot_infectsuscep-1.png b/docs/reference/plot_infectsuscep-1.png index 442dca7..bf7ec50 100644 Binary files a/docs/reference/plot_infectsuscep-1.png and b/docs/reference/plot_infectsuscep-1.png differ diff --git a/docs/reference/plot_infectsuscep.html b/docs/reference/plot_infectsuscep.html index f9cf34c..3a087b4 100644 --- a/docs/reference/plot_infectsuscep.html +++ b/docs/reference/plot_infectsuscep.html @@ -21,9 +21,11 @@ + + + - @@ -36,6 +38,7 @@ + @@ -60,7 +63,7 @@ @@ -139,9 +142,8 @@# Generating a random diffnet ----------------------------------------------- set.seed(821) -diffnet <- rdiffnet(100, 5, seed.graph="small-world", seed.nodes="central") +diffnet <- rdiffnet(100, 5, seed.graph="small-world", seed.nodes="central") plot_adopters(diffnet)# Alternatively, we can use a TOA Matrix diff --git a/docs/reference/plot_diffnet-1.png b/docs/reference/plot_diffnet-1.png index 25c52b6..2dc08db 100644 Binary files a/docs/reference/plot_diffnet-1.png and b/docs/reference/plot_diffnet-1.png differ diff --git a/docs/reference/plot_diffnet.html b/docs/reference/plot_diffnet.html index d5dcfc9..c764761 100644 --- a/docs/reference/plot_diffnet.html +++ b/docs/reference/plot_diffnet.html @@ -21,9 +21,11 @@ + + + - @@ -36,6 +38,7 @@ + @@ -60,7 +63,7 @@diff --git a/docs/reference/plot_diffnet2.html b/docs/reference/plot_diffnet2.html index 3b2c89f..42c32af 100644 --- a/docs/reference/plot_diffnet2.html +++ b/docs/reference/plot_diffnet2.html @@ -21,9 +21,11 @@ + + + - @@ -34,6 +36,7 @@ + @@ -58,7 +61,7 @@ @@ -137,11 +140,10 @@Another way of visualizing diffusion
# S3 method for default plot_diffnet2(graph, toa, pers = min(toa, na.rm = TRUE):max(toa, na.rm = TRUE), - color.ramp = grDevices::colorRamp(c("steelblue", "gray", "tomato")), - layout = NULL, key.width = 0.1, key.args = list(), - main = "Diffusion dynamics", add.map = NULL, - diffmap.args = list(kde2d.args = list(n = 100)), diffmap.alpha = 0.5, - include.white = "first", vertex.size = "degree", + color.ramp = grDevices::colorRamp(viridis::magma(20)), layout = NULL, + key.width = 0.1, key.args = list(), main = "Diffusion dynamics", + add.map = NULL, diffmap.args = list(kde2d.args = list(n = 100)), + diffmap.alpha = 0.5, include.white = "first", vertex.size = "degree", minmax.relative.size = getOption("diffnet.minmax.relative.size", c(0.01, 0.04)), no.graph = FALSE, ...)Plot distribution of infect/suscep
main = "Distribution of Infectiousness and\nSusceptibility", xlab = "Infectiousness of ego", ylab = "Susceptibility of ego", sub = ifelse(logscale, "(in log-scale)", NA), - color.palette = grDevices::colorRampPalette(c("skyblue", "tomato")), - include.grid = TRUE, exclude.zeros = FALSE, - valued = getOption("diffnet.valued", FALSE), ...)Arguments
expo | -\(n\times T\) matrix. Esposure to the innovation obtained from |
+ \(n\times T\) matrix. Esposure to the innovation obtained from |
||||
---|---|---|---|---|---|---|
... | @@ -182,7 +185,7 @@||||||
attrs | -Passed to |
+ Passed to |
||||
undirected | @@ -313,7 +316,7 @@||||||
exposure.args | -List. Arguments to be passed to |
+ List. Arguments to be passed to |
||||
name | @@ -257,7 +260,7 @@||||||
obj | Either a \(n\times T\) matrix (eposure to the innovation obtained from
- |
+|||||
toa | @@ -162,7 +165,7 @@||||||
... | -Further arguments to be passed to |
+ Further arguments to be passed to |
Other statistics: bass
,
classify_adopters
,
cumulative_adopt_count
, dgr
,
- ego_variance
, exposure
,
+ ego_variance
, exposure
,
hazard_rate
, infection
,
moran
, struct_equiv
,
- vertex_covariate_dist
vertex_covariate_dist
Other dyadic-level comparison functions: matrix_compare
,
- vertex_covariate_dist
vertex_covariate_dist
Other statistics: bass
,
classify_adopters
,
cumulative_adopt_count
, dgr
,
- ego_variance
, exposure
,
+ ego_variance
, exposure
,
hazard_rate
, infection
,
moran
, struct_equiv
,
threshold