diff --git a/.Rbuildignore b/.Rbuildignore index 531a45cd..e0e05816 100755 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -34,3 +34,4 @@ makefile ^docs$ ^LICENSE\.md$ ^_pkgdown\.yml$ +^netdiffuseR\.tar\.gz$ diff --git a/.travis.yml b/.travis.yml index 28eb70f7..6b1cbea1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,15 +2,19 @@ dist: trusty language: r sudo: false -r: - - release - - oldrel - -os: - - linux - - osx - -osx_image: xcode7.3 +matrix: +include: + - os: linux + r: oldrel + - os: linux + r: release + env: + - R_CODECOV=true + - BUILD_WWW_HERE=true + - os: linux + r: devel + - os: osx + osx_image: xcode10.2 env: global: @@ -36,3 +40,13 @@ notifications: email: on_success: change on_failure: change + +# For automatic deploy of the website +before_deploy: Rscript -e 'remotes::install_cran("pkgdown")' +deploy: + provider: script + script: Rscript -e 'pkgdown::deploy_site_github()' + skip_cleanup: true + on: + branch: master + condition: $BUILD_WWW_HERE = true diff --git a/DESCRIPTION b/DESCRIPTION index 87bbc6ab..fd7d0a4c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: netdiffuseR Title: Analysis of Diffusion and Contagion Processes on Networks -Version: 1.20.2 -Date: 2019-03-25 +Version: 1.20.999 +Date: 2020-02-03 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") @@ -49,7 +49,7 @@ Suggests: survival VignetteBuilder: knitr LinkingTo: Rcpp, RcppArmadillo -RoxygenNote: 6.1.1 +RoxygenNote: 7.0.2 Encoding: UTF-8 URL: https://github.com/USCCANA/netdiffuseR, https://USCCANA.github.io/netdiffuseR diff --git a/R/adjmat.r b/R/adjmat.r index 25f92d45..b7038330 100644 --- a/R/adjmat.r +++ b/R/adjmat.r @@ -465,12 +465,16 @@ toa_mat <- function(obj, labels=NULL, t0=NULL, t1=NULL) { if (!length(t1)) t1 <- max(obj, na.rm = TRUE) } - ans <- switch(class(obj), - numeric = toa_mat.numeric(obj, labels, t0, t1), - integer = toa_mat.integer(obj, labels, t0, t1), - diffnet = with(obj, list(adopt=adopt,cumadopt=cumadopt)), - stopifnot_graph(obj) - ) + cls <- class(obj) + ans <- if ("numeric" %in% cls) { + toa_mat.numeric(obj, labels, t0, t1) + } else if ("integer" %in% cls) { + toa_mat.integer(obj, labels, t0, t1) + } else if ("diffnet" %in% cls) { + with(obj, list(adopt=adopt,cumadopt=cumadopt)) + } else + stopifnot_graph(obj) + if (inherits(obj, "diffnet")) { dimnames(ans$adopt) <- with(obj$meta, list(ids,pers)) diff --git a/R/diffnet-methods.r b/R/diffnet-methods.r index 041003f8..96eb2df0 100644 --- a/R/diffnet-methods.r +++ b/R/diffnet-methods.r @@ -1525,16 +1525,22 @@ as.array.diffnet <- function(x, ...) { #' nedges(graph_mat) #' nedges(graph_dgCMatrix) nvertices <- function(graph) { - switch(class(graph), - array = nrow(graph), - matrix = nrow(graph), - dgCMatrix = nrow(graph), - list = nrow(graph[[1]]), - diffnet = graph$meta$n, - igraph = igraph::vcount(graph), - network = network::network.size(graph), - stopifnot_graph(graph) - ) + + cls <- class(graph) + + if (any(c("array", "matrix", "dgCMatrix") %in% cls)) { + nrow(graph) + } else if ("list" %in% cls) { + nrow(graph[[1]]) + } else if ("diffnet" %in% cls) { + graph$meta$n + } else if ("igraph" %in% cls) { + igraph::vcount(graph) + } else if ("network" %in% cls) { + network::network.size(graph) + } else + stopifnot_graph(graph) + } #' @rdname nvertices @@ -1544,32 +1550,41 @@ nnodes <- nvertices #' @export #' @rdname nvertices nedges <- function(graph) { - switch (class(graph), - array = { - # Computing and coercing into a list - x <- as.list(apply(graph, 3, function(x) sum(x!=0))) - - # Naming - tnames <- names(x) - if (!length(tnames)) names(x) <- 1:length(x) - x - }, - matrix = sum(graph != 0), - dgCMatrix = length(graph@i), - list = { - # Computing - x <- lapply(graph, function(x) length(x@i)) - - # Naming - tnames <- names(x) - if (!length(tnames)) names(x) <- 1:length(x) - x - }, - diffnet = lapply(graph$graph, function(x) sum(x@x != 0)), - igraph = igraph::ecount(graph), - network = network::network.edgecount(graph), + + cls <- class(graph) + + if ("matrix" %in% cls) { + sum(graph != 0) + } else if ("array" %in% cls) { + # Computing and coercing into a list + x <- as.list(apply(graph, 3, function(x) sum(x!=0))) + + # Naming + tnames <- names(x) + if (!length(tnames)) names(x) <- 1:length(x) + x + + } else if ("dgCMatrix" %in% cls) { + length(graph@i) + } else if ("list" %in% cls) { + + # Computing + x <- lapply(graph, function(x) length(x@i)) + + # Naming + tnames <- names(x) + if (!length(tnames)) names(x) <- 1:length(x) + x + + } else if ("diffnet" %in% cls) { + lapply(graph$graph, function(x) sum(x@x != 0)) + } else if ("igraph" %in% cls) { + igraph::ecount(graph) + } else if ("network" %in% cls) { + network::network.edgecount(graph) + } else stopifnot_graph(graph) - ) + } #' @export @@ -1579,14 +1594,22 @@ nlinks <- nedges #' @export #' @rdname nvertices nslices <- function(graph) { - switch (class(graph), - array = dim(graph)[3], - matrix = 1L, - dgCMatrix = 1L, - diffnet = graph$meta$nper, - list = length(graph), + + cls <- class(graph) + + if ("matrix" %in% cls) { + 1L + } else if ("array" %in% cls) { + dim(graph)[3] + } else if ("dgCMatrix" %in% cls) { + 1L + } else if ("diffnet" %in% cls) { + graph$meta$nper + } else if ("list" %in% cls) { + length(graph) + } else stopifnot_graph(graph) - ) + } #' @export diff --git a/R/egonets.R b/R/egonets.R index 479c537b..65aa0a05 100644 --- a/R/egonets.R +++ b/R/egonets.R @@ -167,9 +167,10 @@ egonet_attrs <- function( 1, " and ", nnodes(graph), ".") } - switch( - class(graph), - diffnet = egonet_attrs.list( + cls <- class(graph) + + if ("diffnet" %in% cls) { + egonet_attrs.list( graph = graph$graph, attrs = attrs, V = V, @@ -179,8 +180,9 @@ egonet_attrs <- function( self = self, valued = valued, ... - ), - list = egonet_attrs.list( + ) + } else if ("list" %in% cls) { + egonet_attrs.list( graph = graph, attrs = attrs, V = V, @@ -190,8 +192,9 @@ egonet_attrs <- function( self = self, valued = valued, ... - ), - matrix = egonet_attrs.matrix( + ) + } else if ("matrix" %in% cls) { + egonet_attrs.matrix( graph = as_spmat(graph), attrs = attrs, V = V, @@ -201,8 +204,9 @@ egonet_attrs <- function( self = self, valued = valued, ... - ), - dgCMatrix = egonet_attrs.matrix( + ) + } else if ("dgCMatrix" %in% cls) { + egonet_attrs.matrix( graph = graph, attrs = attrs, V = V, @@ -212,8 +216,9 @@ egonet_attrs <- function( self = self, valued = valued, ... - ), - array = egonet_attrs.array( + ) + } else if ("array" %in% cls) { + egonet_attrs.array( graph = graph, attrs = attrs, V = V, @@ -223,9 +228,10 @@ egonet_attrs <- function( self = self, valued = valued, ... - ), + ) + } else stopifnot_graph(graph) - ) + } egonet_attrs.matrix <- function(graph, attrs, V, outer, fun, as.df, self, valued, ...) { diff --git a/_pkgdown.yml b/_pkgdown.yml index e69de29b..76b39d4e 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -0,0 +1,4 @@ +template: + params: + ganalytics: UA-40608305-5 + diff --git a/makefile b/makefile index 978868a4..8134c236 100644 --- a/makefile +++ b/makefile @@ -1,11 +1,15 @@ -news: +netdiffuseR.tar.gz: */*.R + rm netdiffuseR.tar.gz ; \ + R CMD build . && \ + mv netdiffuseR*.tar.gz netdiffuseR.tar.gz + +inst/NEWS: NEWS.md Rscript -e "rmarkdown::pandoc_convert('NEWS.md', 'plain', output='inst/NEWS')"&& \ head -n 80 inst/NEWS -check: - cd ..&&R CMD build netdiffuseR/ && \ - R CMD check --as-cran netdiffuseR*.tar.gz +check: netdiffuseR.tar.gz + R CMD check --as-cran netdiffuseR.tar.gz -checkv: +checkv: netdiffuseR.tar.gz cd ..&&R CMD build netdiffuseR/ && \ R CMD check --as-cran --use-valgrind netdiffuseR*.tar.gz diff --git a/man/as.array.diffnet.Rd b/man/as.array.diffnet.Rd index b97ec97d..f8ff72ac 100644 --- a/man/as.array.diffnet.Rd +++ b/man/as.array.diffnet.Rd @@ -35,10 +35,13 @@ as.array(mydiffnet) \seealso{ \code{\link{diffnet}}. -Other diffnet methods: \code{\link{\%*\%}}, - \code{\link{c.diffnet}}, - \code{\link{diffnet-arithmetic}}, - \code{\link{diffnet-class}}, \code{\link{diffnet_index}}, - \code{\link{plot.diffnet}}, \code{\link{summary.diffnet}} +Other diffnet methods: +\code{\link{\%*\%}()}, +\code{\link{c.diffnet}()}, +\code{\link{diffnet-arithmetic}}, +\code{\link{diffnet-class}}, +\code{\link{diffnet_index}}, +\code{\link{plot.diffnet}()}, +\code{\link{summary.diffnet}()} } \concept{diffnet methods} diff --git a/man/bass.Rd b/man/bass.Rd index f13e68e7..97f652bd 100644 --- a/man/bass.Rd +++ b/man/bass.Rd @@ -17,11 +17,21 @@ fitbass(dat, ...) \method{fitbass}{default}(dat, ...) -\method{plot}{diffnet_bass}(x, y = 1:length(x$m$lhs()), add = FALSE, - pch = c(21, 24), main = "Bass Diffusion Model", - ylab = "Proportion of adopters", xlab = "Time", type = c("b", "b"), - lty = c(2, 1), col = c("black", "black"), bg = c("lightblue", - "gray"), include.legend = TRUE, ...) +\method{plot}{diffnet_bass}( + x, + y = 1:length(x$m$lhs()), + add = FALSE, + pch = c(21, 24), + main = "Bass Diffusion Model", + ylab = "Proportion of adopters", + xlab = "Time", + type = c("b", "b"), + lty = c(2, 1), + col = c("black", "black"), + bg = c("lightblue", "gray"), + include.legend = TRUE, + ... +) bass_F(Time, p, q) @@ -124,13 +134,18 @@ Bass's Basement Institute Institute. The Bass Model. (2010). Available at: \url{http://www.bassbasement.org/BassModel/Default.aspx}. (Accessed: 29th March 2017) } \seealso{ -Other statistics: \code{\link{classify_adopters}}, - \code{\link{cumulative_adopt_count}}, \code{\link{dgr}}, - \code{\link{ego_variance}}, \code{\link{exposure}}, - \code{\link{hazard_rate}}, \code{\link{infection}}, - \code{\link{moran}}, \code{\link{struct_equiv}}, - \code{\link{threshold}}, - \code{\link{vertex_covariate_dist}} +Other statistics: +\code{\link{classify_adopters}()}, +\code{\link{cumulative_adopt_count}()}, +\code{\link{dgr}()}, +\code{\link{ego_variance}()}, +\code{\link{exposure}()}, +\code{\link{hazard_rate}()}, +\code{\link{infection}()}, +\code{\link{moran}()}, +\code{\link{struct_equiv}()}, +\code{\link{threshold}()}, +\code{\link{vertex_covariate_dist}()} } \author{ George G. Vega Yon diff --git a/man/bootnet.Rd b/man/bootnet.Rd index 950db545..5173be19 100644 --- a/man/bootnet.Rd +++ b/man/bootnet.Rd @@ -16,12 +16,17 @@ bootnet(graph, statistic, R, resample.args = list(self = FALSE), ...) \method{print}{diffnet_bootnet}(x, ...) -\method{hist}{diffnet_bootnet}(x, +\method{hist}{diffnet_bootnet}( + x, main = "Empirical Distribution of Statistic", - xlab = expression(Values ~ of ~ t), breaks = 20, annotated = TRUE, + xlab = expression(Values ~ of ~ t), + breaks = 20, + annotated = TRUE, b0 = expression(atop(plain("") \%up\% plain("")), t[0]), - b = expression(atop(plain("") \%up\% plain("")), t[]), ask = TRUE, - ...) + b = expression(atop(plain("") \%up\% plain("")), t[]), + ask = TRUE, + ... +) } \arguments{ \item{graph}{Any class of accepted graph format (see \code{\link{netdiffuseR-graphs}}).} @@ -114,7 +119,8 @@ Standard Errors and Tests for Network Statistics. Connections, 22(2), 1–10. Retrieved from \url{https://www.stats.ox.ac.uk/~snijders/Snijders_Borgatti.pdf} } \seealso{ -Other Functions for inference: \code{\link{moran}}, - \code{\link{struct_test}} +Other Functions for inference: +\code{\link{moran}()}, +\code{\link{struct_test}()} } \concept{Functions for inference} diff --git a/man/brfarmers.Rd b/man/brfarmers.Rd index 99638d02..49111ff7 100644 --- a/man/brfarmers.Rd +++ b/man/brfarmers.Rd @@ -188,14 +188,17 @@ Valente, T. W. (1995). Network models of the diffusion of innovations (2nd ed.). Cresskill N.J.: Hampton Press. } \seealso{ -Other diffusion datasets: \code{\link{brfarmersDiffNet}}, - \code{\link{diffusion-data}}, - \code{\link{fakeDynEdgelist}}, - \code{\link{fakeEdgelist}}, \code{\link{fakesurveyDyn}}, - \code{\link{fakesurvey}}, \code{\link{kfamilyDiffNet}}, - \code{\link{kfamily}}, - \code{\link{medInnovationsDiffNet}}, - \code{\link{medInnovations}} +Other diffusion datasets: +\code{\link{brfarmersDiffNet}}, +\code{\link{diffusion-data}}, +\code{\link{fakeDynEdgelist}}, +\code{\link{fakeEdgelist}}, +\code{\link{fakesurveyDyn}}, +\code{\link{fakesurvey}}, +\code{\link{kfamilyDiffNet}}, +\code{\link{kfamily}}, +\code{\link{medInnovationsDiffNet}}, +\code{\link{medInnovations}} } \concept{diffusion datasets} \keyword{datasets} diff --git a/man/brfarmersDiffNet.Rd b/man/brfarmersDiffNet.Rd index 1ddf48be..08b114c4 100644 --- a/man/brfarmersDiffNet.Rd +++ b/man/brfarmersDiffNet.Rd @@ -9,13 +9,16 @@ A directed dynamic graph with 692 vertices and 21 time periods. The attributes in the graph are static and described in \code{\link{brfarmers}}. } \seealso{ -Other diffusion datasets: \code{\link{brfarmers}}, - \code{\link{diffusion-data}}, - \code{\link{fakeDynEdgelist}}, - \code{\link{fakeEdgelist}}, \code{\link{fakesurveyDyn}}, - \code{\link{fakesurvey}}, \code{\link{kfamilyDiffNet}}, - \code{\link{kfamily}}, - \code{\link{medInnovationsDiffNet}}, - \code{\link{medInnovations}} +Other diffusion datasets: +\code{\link{brfarmers}}, +\code{\link{diffusion-data}}, +\code{\link{fakeDynEdgelist}}, +\code{\link{fakeEdgelist}}, +\code{\link{fakesurveyDyn}}, +\code{\link{fakesurvey}}, +\code{\link{kfamilyDiffNet}}, +\code{\link{kfamily}}, +\code{\link{medInnovationsDiffNet}}, +\code{\link{medInnovations}} } \concept{diffusion datasets} diff --git a/man/c.diffnet.Rd b/man/c.diffnet.Rd index cdb6aa92..023b91cc 100644 --- a/man/c.diffnet.Rd +++ b/man/c.diffnet.Rd @@ -58,10 +58,13 @@ diffnet } \seealso{ -Other diffnet methods: \code{\link{\%*\%}}, - \code{\link{as.array.diffnet}}, - \code{\link{diffnet-arithmetic}}, - \code{\link{diffnet-class}}, \code{\link{diffnet_index}}, - \code{\link{plot.diffnet}}, \code{\link{summary.diffnet}} +Other diffnet methods: +\code{\link{\%*\%}()}, +\code{\link{as.array.diffnet}()}, +\code{\link{diffnet-arithmetic}}, +\code{\link{diffnet-class}}, +\code{\link{diffnet_index}}, +\code{\link{plot.diffnet}()}, +\code{\link{summary.diffnet}()} } \concept{diffnet methods} diff --git a/man/classify_adopters.Rd b/man/classify_adopters.Rd index 2131a376..a3c0d9f4 100644 --- a/man/classify_adopters.Rd +++ b/man/classify_adopters.Rd @@ -16,16 +16,21 @@ classify(...) \method{classify_adopters}{diffnet}(graph, include_censored = FALSE, ...) -\method{classify_adopters}{default}(graph, toa, t0 = NULL, t1 = NULL, - expo = NULL, include_censored = FALSE, ...) +\method{classify_adopters}{default}( + graph, + toa, + t0 = NULL, + t1 = NULL, + expo = NULL, + include_censored = FALSE, + ... +) \method{ftable}{diffnet_adopters}(x, as.pcent = TRUE, digits = 2, ...) -\method{as.data.frame}{diffnet_adopters}(x, row.names = NULL, - optional = FALSE, ...) +\method{as.data.frame}{diffnet_adopters}(x, row.names = NULL, optional = FALSE, ...) -\method{plot}{diffnet_adopters}(x, y = NULL, ftable.args = list(), - table.args = list(), ...) +\method{plot}{diffnet_adopters}(x, y = NULL, ftable.args = list(), table.args = list(), ...) } \arguments{ \item{...}{Further arguments passed to the method.} @@ -129,13 +134,18 @@ Valente, T. W. (1995). "Network models of the diffusion of innovations" (2nd ed.). Cresskill N.J.: Hampton Press. } \seealso{ -Other statistics: \code{\link{bass}}, - \code{\link{cumulative_adopt_count}}, \code{\link{dgr}}, - \code{\link{ego_variance}}, \code{\link{exposure}}, - \code{\link{hazard_rate}}, \code{\link{infection}}, - \code{\link{moran}}, \code{\link{struct_equiv}}, - \code{\link{threshold}}, - \code{\link{vertex_covariate_dist}} +Other statistics: +\code{\link{bass}}, +\code{\link{cumulative_adopt_count}()}, +\code{\link{dgr}()}, +\code{\link{ego_variance}()}, +\code{\link{exposure}()}, +\code{\link{hazard_rate}()}, +\code{\link{infection}()}, +\code{\link{moran}()}, +\code{\link{struct_equiv}()}, +\code{\link{threshold}()}, +\code{\link{vertex_covariate_dist}()} } \author{ George G. Vega Yon diff --git a/man/cumulative_adopt_count.Rd b/man/cumulative_adopt_count.Rd index 0c1610d0..c78f340a 100644 --- a/man/cumulative_adopt_count.Rd +++ b/man/cumulative_adopt_count.Rd @@ -28,13 +28,18 @@ where \eqn{q_i}{q(i)} is the number of adopters in time \eqn{t}. Note that it is only calculated fot \eqn{t>1}. } \seealso{ -Other statistics: \code{\link{bass}}, - \code{\link{classify_adopters}}, \code{\link{dgr}}, - \code{\link{ego_variance}}, \code{\link{exposure}}, - \code{\link{hazard_rate}}, \code{\link{infection}}, - \code{\link{moran}}, \code{\link{struct_equiv}}, - \code{\link{threshold}}, - \code{\link{vertex_covariate_dist}} +Other statistics: +\code{\link{bass}}, +\code{\link{classify_adopters}()}, +\code{\link{dgr}()}, +\code{\link{ego_variance}()}, +\code{\link{exposure}()}, +\code{\link{hazard_rate}()}, +\code{\link{infection}()}, +\code{\link{moran}()}, +\code{\link{struct_equiv}()}, +\code{\link{threshold}()}, +\code{\link{vertex_covariate_dist}()} } \author{ George G. Vega Yon & Thomas W. Valente diff --git a/man/dgr.Rd b/man/dgr.Rd index 9ee04b03..3825f669 100644 --- a/man/dgr.Rd +++ b/man/dgr.Rd @@ -8,14 +8,26 @@ \alias{plot.diffnet_degSeq} \title{Indegree, outdegree and degree of the vertices} \usage{ -dgr(graph, cmode = "degree", +dgr( + graph, + cmode = "degree", undirected = getOption("diffnet.undirected", FALSE), self = getOption("diffnet.self", FALSE), - valued = getOption("diffnet.valued", FALSE)) - -\method{plot}{diffnet_degSeq}(x, breaks = min(100L, nrow(x)/5), - freq = FALSE, y = NULL, log = "xy", hist.args = list(), - slice = ncol(x), xlab = "Degree", ylab = "Freq", ...) + valued = getOption("diffnet.valued", FALSE) +) + +\method{plot}{diffnet_degSeq}( + x, + breaks = min(100L, nrow(x)/5), + freq = FALSE, + y = NULL, + log = "xy", + hist.args = list(), + slice = ncol(x), + xlab = "Degree", + ylab = "Freq", + ... +) } \arguments{ \item{graph}{Any class of accepted graph format (see \code{\link{netdiffuseR-graphs}}).} @@ -88,23 +100,30 @@ suppressWarnings(plot(dgr(g))) } \seealso{ -Other statistics: \code{\link{bass}}, - \code{\link{classify_adopters}}, - \code{\link{cumulative_adopt_count}}, - \code{\link{ego_variance}}, \code{\link{exposure}}, - \code{\link{hazard_rate}}, \code{\link{infection}}, - \code{\link{moran}}, \code{\link{struct_equiv}}, - \code{\link{threshold}}, - \code{\link{vertex_covariate_dist}} - -Other visualizations: \code{\link{diffusionMap}}, - \code{\link{drawColorKey}}, - \code{\link{grid_distribution}}, - \code{\link{hazard_rate}}, \code{\link{plot_adopters}}, - \code{\link{plot_diffnet2}}, \code{\link{plot_diffnet}}, - \code{\link{plot_infectsuscep}}, - \code{\link{plot_threshold}}, - \code{\link{rescale_vertex_igraph}} +Other statistics: +\code{\link{bass}}, +\code{\link{classify_adopters}()}, +\code{\link{cumulative_adopt_count}()}, +\code{\link{ego_variance}()}, +\code{\link{exposure}()}, +\code{\link{hazard_rate}()}, +\code{\link{infection}()}, +\code{\link{moran}()}, +\code{\link{struct_equiv}()}, +\code{\link{threshold}()}, +\code{\link{vertex_covariate_dist}()} + +Other visualizations: +\code{\link{diffusionMap}()}, +\code{\link{drawColorKey}()}, +\code{\link{grid_distribution}()}, +\code{\link{hazard_rate}()}, +\code{\link{plot_adopters}()}, +\code{\link{plot_diffnet2}()}, +\code{\link{plot_diffnet}()}, +\code{\link{plot_infectsuscep}()}, +\code{\link{plot_threshold}()}, +\code{\link{rescale_vertex_igraph}()} } \author{ George G. Vega Yon diff --git a/man/diag_expand.Rd b/man/diag_expand.Rd index dece76c6..23f9766a 100644 --- a/man/diag_expand.Rd +++ b/man/diag_expand.Rd @@ -11,22 +11,42 @@ \usage{ diag_expand(...) -\method{diag_expand}{list}(graph, self = getOption("diffnet.self"), - valued = getOption("diffnet.valued"), ...) +\method{diag_expand}{list}( + graph, + self = getOption("diffnet.self"), + valued = getOption("diffnet.valued"), + ... +) -\method{diag_expand}{diffnet}(graph, self = getOption("diffnet.self"), - valued = getOption("diffnet.valued"), ...) +\method{diag_expand}{diffnet}( + graph, + self = getOption("diffnet.self"), + valued = getOption("diffnet.valued"), + ... +) -\method{diag_expand}{matrix}(graph, nper, +\method{diag_expand}{matrix}( + graph, + nper, self = getOption("diffnet.self"), - valued = getOption("diffnet.valued"), ...) + valued = getOption("diffnet.valued"), + ... +) -\method{diag_expand}{array}(graph, self = getOption("diffnet.self"), - valued = getOption("diffnet.valued"), ...) +\method{diag_expand}{array}( + graph, + self = getOption("diffnet.self"), + valued = getOption("diffnet.valued"), + ... +) -\method{diag_expand}{dgCMatrix}(graph, nper, +\method{diag_expand}{dgCMatrix}( + graph, + nper, self = getOption("diffnet.self"), - valued = getOption("diffnet.valued"), ...) + valued = getOption("diffnet.valued"), + ... +) } \arguments{ \item{...}{Further arguments to be passed to the method.} diff --git a/man/diffnet-arithmetic.Rd b/man/diffnet-arithmetic.Rd index 3d231c9c..7ea556dd 100644 --- a/man/diffnet-arithmetic.Rd +++ b/man/diffnet-arithmetic.Rd @@ -78,9 +78,13 @@ medInnovationsDiffNet - 1:3 medInnovationsDiffNet - as.character(1001:1003) } \seealso{ -Other diffnet methods: \code{\link{\%*\%}}, - \code{\link{as.array.diffnet}}, \code{\link{c.diffnet}}, - \code{\link{diffnet-class}}, \code{\link{diffnet_index}}, - \code{\link{plot.diffnet}}, \code{\link{summary.diffnet}} +Other diffnet methods: +\code{\link{\%*\%}()}, +\code{\link{as.array.diffnet}()}, +\code{\link{c.diffnet}()}, +\code{\link{diffnet-class}}, +\code{\link{diffnet_index}}, +\code{\link{plot.diffnet}()}, +\code{\link{summary.diffnet}()} } \concept{diffnet methods} diff --git a/man/diffnet-class.Rd b/man/diffnet-class.Rd index 435358fe..88202924 100644 --- a/man/diffnet-class.Rd +++ b/man/diffnet-class.Rd @@ -27,22 +27,38 @@ as_diffnet(graph, ...) \method{as_diffnet}{networkDynamic}(graph, toavar, ...) -new_diffnet(graph, toa, t0 = min(toa, na.rm = TRUE), t1 = max(toa, - na.rm = TRUE), vertex.dyn.attrs = NULL, vertex.static.attrs = NULL, - id.and.per.vars = NULL, graph.attrs = NULL, +new_diffnet( + graph, + toa, + t0 = min(toa, na.rm = TRUE), + t1 = max(toa, na.rm = TRUE), + vertex.dyn.attrs = NULL, + vertex.static.attrs = NULL, + id.and.per.vars = NULL, + graph.attrs = NULL, undirected = getOption("diffnet.undirected"), self = getOption("diffnet.self"), - multiple = getOption("diffnet.multiple"), name = "Diffusion Network", - behavior = "Unspecified") - -\method{as.data.frame}{diffnet}(x, row.names = NULL, optional = FALSE, - attr.class = c("dyn", "static"), ...) - -diffnet.attrs(graph, element = c("vertex", "graph"), - attr.class = c("dyn", "static"), as.df = FALSE) - -diffnet.attrs(graph, element = "vertex", - attr.class = "static") <- value + multiple = getOption("diffnet.multiple"), + name = "Diffusion Network", + behavior = "Unspecified" +) + +\method{as.data.frame}{diffnet}( + x, + row.names = NULL, + optional = FALSE, + attr.class = c("dyn", "static"), + ... +) + +diffnet.attrs( + graph, + element = c("vertex", "graph"), + attr.class = c("dyn", "static"), + as.df = FALSE +) + +diffnet.attrs(graph, element = "vertex", attr.class = "static") <- value diffnet.toa(graph) @@ -283,15 +299,20 @@ diffnetLapply(medInnovationsDiffNet, function(x, cumadopt, ...) {sum(cumadopt)}) \seealso{ Default options are listed at \code{\link{netdiffuseR-options}} -Other diffnet methods: \code{\link{\%*\%}}, - \code{\link{as.array.diffnet}}, \code{\link{c.diffnet}}, - \code{\link{diffnet-arithmetic}}, - \code{\link{diffnet_index}}, \code{\link{plot.diffnet}}, - \code{\link{summary.diffnet}} - -Other data management functions: \code{\link{edgelist_to_adjmat}}, - \code{\link{egonet_attrs}}, \code{\link{isolated}}, - \code{\link{survey_to_diffnet}} +Other diffnet methods: +\code{\link{\%*\%}()}, +\code{\link{as.array.diffnet}()}, +\code{\link{c.diffnet}()}, +\code{\link{diffnet-arithmetic}}, +\code{\link{diffnet_index}}, +\code{\link{plot.diffnet}()}, +\code{\link{summary.diffnet}()} + +Other data management functions: +\code{\link{edgelist_to_adjmat}()}, +\code{\link{egonet_attrs}()}, +\code{\link{isolated}()}, +\code{\link{survey_to_diffnet}()} } \author{ George G. Vega Yon diff --git a/man/diffnet_index.Rd b/man/diffnet_index.Rd index 9173f9b0..6efab2cd 100644 --- a/man/diffnet_index.Rd +++ b/man/diffnet_index.Rd @@ -130,11 +130,14 @@ identical(x[["expoM"]], x[["expoL"]]) # TRUE identical(x[["expoM"]], x[["expoD"]]) # TRUE } \seealso{ -Other diffnet methods: \code{\link{\%*\%}}, - \code{\link{as.array.diffnet}}, \code{\link{c.diffnet}}, - \code{\link{diffnet-arithmetic}}, - \code{\link{diffnet-class}}, \code{\link{plot.diffnet}}, - \code{\link{summary.diffnet}} +Other diffnet methods: +\code{\link{\%*\%}()}, +\code{\link{as.array.diffnet}()}, +\code{\link{c.diffnet}()}, +\code{\link{diffnet-arithmetic}}, +\code{\link{diffnet-class}}, +\code{\link{plot.diffnet}()}, +\code{\link{summary.diffnet}()} } \author{ George G. Vega Yon diff --git a/man/diffnetmatmult.Rd b/man/diffnetmatmult.Rd index 273c286a..4d9908a9 100644 --- a/man/diffnetmatmult.Rd +++ b/man/diffnetmatmult.Rd @@ -53,10 +53,13 @@ mapply(`-`, nlinks(net), nlinks(netsim)) } \seealso{ -Other diffnet methods: \code{\link{as.array.diffnet}}, - \code{\link{c.diffnet}}, - \code{\link{diffnet-arithmetic}}, - \code{\link{diffnet-class}}, \code{\link{diffnet_index}}, - \code{\link{plot.diffnet}}, \code{\link{summary.diffnet}} +Other diffnet methods: +\code{\link{as.array.diffnet}()}, +\code{\link{c.diffnet}()}, +\code{\link{diffnet-arithmetic}}, +\code{\link{diffnet-class}}, +\code{\link{diffnet_index}}, +\code{\link{plot.diffnet}()}, +\code{\link{summary.diffnet}()} } \concept{diffnet methods} diff --git a/man/diffusion-data.Rd b/man/diffusion-data.Rd index 9519c6b2..c2c5dca2 100644 --- a/man/diffusion-data.Rd +++ b/man/diffusion-data.Rd @@ -81,13 +81,17 @@ In Models and Methods in Social Network Analysis, Volume 28 of Structural Analysis in the Social Sciences (pp. 98–116). New York: Cambridge University Press. } \seealso{ -Other diffusion datasets: \code{\link{brfarmersDiffNet}}, - \code{\link{brfarmers}}, \code{\link{fakeDynEdgelist}}, - \code{\link{fakeEdgelist}}, \code{\link{fakesurveyDyn}}, - \code{\link{fakesurvey}}, \code{\link{kfamilyDiffNet}}, - \code{\link{kfamily}}, - \code{\link{medInnovationsDiffNet}}, - \code{\link{medInnovations}} +Other diffusion datasets: +\code{\link{brfarmersDiffNet}}, +\code{\link{brfarmers}}, +\code{\link{fakeDynEdgelist}}, +\code{\link{fakeEdgelist}}, +\code{\link{fakesurveyDyn}}, +\code{\link{fakesurvey}}, +\code{\link{kfamilyDiffNet}}, +\code{\link{kfamily}}, +\code{\link{medInnovationsDiffNet}}, +\code{\link{medInnovations}} } \author{ Thomas W. Valente diff --git a/man/diffusionMap.Rd b/man/diffusionMap.Rd index e134261f..fcee23ab 100644 --- a/man/diffusionMap.Rd +++ b/man/diffusionMap.Rd @@ -14,10 +14,17 @@ diffusionMap(graph, ...) diffmap(graph, ...) -\method{diffusionMap}{default}(graph, x, x.adj = round_to_seq, - layout = NULL, jitter.args = list(), kde2d.args = list(n = 100), - sharp.criter = function(x, w) { wvar(x, w) > (max(x, na.rm = TRUE) - - min(x, na.rm = TRUE))^2/12 }, ...) +\method{diffusionMap}{default}( + graph, + x, + x.adj = round_to_seq, + layout = NULL, + jitter.args = list(), + kde2d.args = list(n = 100), + sharp.criter = function(x, w) { wvar(x, w) > (max(x, na.rm = TRUE) - min(x, na.rm + = TRUE))^2/12 }, + ... +) \method{diffusionMap}{diffnet}(graph, slice = nslices(graph), ...) @@ -115,7 +122,7 @@ dm1 <- diffusionMap(x, layout = dm0$coords, kde2d.args=list(n=150, h=.5)) oldpar <- par(no.readonly = TRUE) col <- colorRampPalette(blues9)(100) par(mfrow=c(1,2), oma=c(1,0,0,0)) -image(dm0, col=col, main="Non-random Times of Adoption\\nAdoption from the core.") +image(dm0, col=col, main="Non-random Times of Adoption\nAdoption from the core.") image(dm1, col=col, main="Random Times of Adoption") par(mfrow=c(1,1)) mtext("Both networks have the same distribution on times of adoption", 1, @@ -151,14 +158,17 @@ Vega Yon, George G., and Valente, Thomas W., Visualizing Large Annotated Networks as Heatmaps using Weighted Averages based on Kernel Smoothers (Working paper). } \seealso{ -Other visualizations: \code{\link{dgr}}, - \code{\link{drawColorKey}}, - \code{\link{grid_distribution}}, - \code{\link{hazard_rate}}, \code{\link{plot_adopters}}, - \code{\link{plot_diffnet2}}, \code{\link{plot_diffnet}}, - \code{\link{plot_infectsuscep}}, - \code{\link{plot_threshold}}, - \code{\link{rescale_vertex_igraph}} +Other visualizations: +\code{\link{dgr}()}, +\code{\link{drawColorKey}()}, +\code{\link{grid_distribution}()}, +\code{\link{hazard_rate}()}, +\code{\link{plot_adopters}()}, +\code{\link{plot_diffnet2}()}, +\code{\link{plot_diffnet}()}, +\code{\link{plot_infectsuscep}()}, +\code{\link{plot_threshold}()}, +\code{\link{rescale_vertex_igraph}()} } \author{ George G. Vega Yon diff --git a/man/drawColorKey.Rd b/man/drawColorKey.Rd index ffba22ef..6804a03d 100644 --- a/man/drawColorKey.Rd +++ b/man/drawColorKey.Rd @@ -4,12 +4,22 @@ \alias{drawColorKey} \title{Draw a color key in the current device} \usage{ -drawColorKey(x, tick.marks = pretty_within(x), labels = tick.marks, - main = NULL, key.pos = c(0.925, 0.975, 0.05, 0.95), pos = 2, +drawColorKey( + x, + tick.marks = pretty_within(x), + labels = tick.marks, + main = NULL, + key.pos = c(0.925, 0.975, 0.05, 0.95), + pos = 2, nlevels = length(tick.marks), - color.palette = viridisLite::viridis(nlevels), tick.width = c(0.01, - 0.0075), add.box = TRUE, na.col = NULL, na.height = 0.1, - na.lab = "n/a", ...) + color.palette = viridisLite::viridis(nlevels), + tick.width = c(0.01, 0.0075), + add.box = TRUE, + na.col = NULL, + na.height = 0.1, + na.lab = "n/a", + ... +) } \arguments{ \item{x}{A numeric vector with the data (it is used to extract the range).} @@ -58,17 +68,20 @@ col <- colorRamp(c("lightblue", "yellow", "red"))((x - min(x))/(max(x) - min(x)) col <- rgb(col, maxColorValue = 255) plot(x, col=col, pch=19) drawColorKey(x, nlevels = 100, border="transparent", - main="Key\\nLike A\\nBoss") + main="Key\nLike A\nBoss") } \seealso{ -Other visualizations: \code{\link{dgr}}, - \code{\link{diffusionMap}}, - \code{\link{grid_distribution}}, - \code{\link{hazard_rate}}, \code{\link{plot_adopters}}, - \code{\link{plot_diffnet2}}, \code{\link{plot_diffnet}}, - \code{\link{plot_infectsuscep}}, - \code{\link{plot_threshold}}, - \code{\link{rescale_vertex_igraph}} +Other visualizations: +\code{\link{dgr}()}, +\code{\link{diffusionMap}()}, +\code{\link{grid_distribution}()}, +\code{\link{hazard_rate}()}, +\code{\link{plot_adopters}()}, +\code{\link{plot_diffnet2}()}, +\code{\link{plot_diffnet}()}, +\code{\link{plot_infectsuscep}()}, +\code{\link{plot_threshold}()}, +\code{\link{rescale_vertex_igraph}()} } \author{ George G. Vega Yon diff --git a/man/edgelist_to_adjmat.Rd b/man/edgelist_to_adjmat.Rd index d80b6c05..94cb0d88 100644 --- a/man/edgelist_to_adjmat.Rd +++ b/man/edgelist_to_adjmat.Rd @@ -5,15 +5,25 @@ \alias{adjmat_to_edgelist} \title{Conversion between adjacency matrix and edgelist} \usage{ -edgelist_to_adjmat(edgelist, w = NULL, t0 = NULL, t1 = NULL, - t = NULL, simplify = TRUE, +edgelist_to_adjmat( + edgelist, + w = NULL, + t0 = NULL, + t1 = NULL, + t = NULL, + simplify = TRUE, undirected = getOption("diffnet.undirected"), self = getOption("diffnet.self"), - multiple = getOption("diffnet.multiple"), keep.isolates = TRUE, - recode.ids = TRUE) + multiple = getOption("diffnet.multiple"), + keep.isolates = TRUE, + recode.ids = TRUE +) -adjmat_to_edgelist(graph, undirected = getOption("diffnet.undirected", - FALSE), keep.isolates = getOption("diffnet.keep.isolates", TRUE)) +adjmat_to_edgelist( + graph, + undirected = getOption("diffnet.undirected", FALSE), + keep.isolates = getOption("diffnet.keep.isolates", TRUE) +) } \arguments{ \item{edgelist}{Two column matrix/data.frame in the form of ego -source- and @@ -158,9 +168,11 @@ edgelist } \seealso{ -Other data management functions: \code{\link{diffnet-class}}, - \code{\link{egonet_attrs}}, \code{\link{isolated}}, - \code{\link{survey_to_diffnet}} +Other data management functions: +\code{\link{diffnet-class}}, +\code{\link{egonet_attrs}()}, +\code{\link{isolated}()}, +\code{\link{survey_to_diffnet}()} } \author{ George G. Vega Yon & Thomas W. Valente diff --git a/man/edges_coords.Rd b/man/edges_coords.Rd index 75b744b6..c7bd535d 100644 --- a/man/edges_coords.Rd +++ b/man/edges_coords.Rd @@ -4,9 +4,18 @@ \alias{edges_coords} \title{Compute ego/alter edge coordinates considering alter's size and aspect ratio} \usage{ -edges_coords(graph, toa, x, y, vertex_cex, undirected = TRUE, - no_contemporary = TRUE, dev = as.numeric(c()), - ran = as.numeric(c()), curved = as.logical(c())) +edges_coords( + graph, + toa, + x, + y, + vertex_cex, + undirected = TRUE, + no_contemporary = TRUE, + dev = as.numeric(c()), + ran = as.numeric(c()), + curved = as.logical(c()) +) } \arguments{ \item{graph}{A square matrix of size \eqn{n}. Adjacency matrix.} diff --git a/man/ego_variance.Rd b/man/ego_variance.Rd index dc287523..5a7d6dc8 100644 --- a/man/ego_variance.Rd +++ b/man/ego_variance.Rd @@ -45,12 +45,17 @@ relative variance. \seealso{ \code{\link{struct_test}} -Other statistics: \code{\link{bass}}, - \code{\link{classify_adopters}}, - \code{\link{cumulative_adopt_count}}, \code{\link{dgr}}, - \code{\link{exposure}}, \code{\link{hazard_rate}}, - \code{\link{infection}}, \code{\link{moran}}, - \code{\link{struct_equiv}}, \code{\link{threshold}}, - \code{\link{vertex_covariate_dist}} +Other statistics: +\code{\link{bass}}, +\code{\link{classify_adopters}()}, +\code{\link{cumulative_adopt_count}()}, +\code{\link{dgr}()}, +\code{\link{exposure}()}, +\code{\link{hazard_rate}()}, +\code{\link{infection}()}, +\code{\link{moran}()}, +\code{\link{struct_equiv}()}, +\code{\link{threshold}()}, +\code{\link{vertex_covariate_dist}()} } \concept{statistics} diff --git a/man/egonet_attrs.Rd b/man/egonet_attrs.Rd index 1eb700ac..f7c6d50f 100644 --- a/man/egonet_attrs.Rd +++ b/man/egonet_attrs.Rd @@ -4,10 +4,17 @@ \alias{egonet_attrs} \title{Retrieve alter's attributes (network effects)} \usage{ -egonet_attrs(graph, attrs, V = NULL, direction = "outgoing", - fun = function(x) x, as.df = FALSE, +egonet_attrs( + graph, + attrs, + V = NULL, + direction = "outgoing", + fun = function(x) x, + as.df = FALSE, self = getOption("diffnet.self"), - valued = getOption("diffnet.valued"), ...) + valued = getOption("diffnet.valued"), + ... +) } \arguments{ \item{graph}{Any class of accepted graph format (see \code{\link{netdiffuseR-graphs}}).} @@ -131,9 +138,11 @@ max(someattr[which(net[3,] == 1),"a"]) == ans[3] # TRUE } \seealso{ -Other data management functions: \code{\link{diffnet-class}}, - \code{\link{edgelist_to_adjmat}}, \code{\link{isolated}}, - \code{\link{survey_to_diffnet}} +Other data management functions: +\code{\link{diffnet-class}}, +\code{\link{edgelist_to_adjmat}()}, +\code{\link{isolated}()}, +\code{\link{survey_to_diffnet}()} } \author{ George G. Vega Yon diff --git a/man/exposure.Rd b/man/exposure.Rd index 02cee580..7ea6933e 100644 --- a/man/exposure.Rd +++ b/man/exposure.Rd @@ -4,10 +4,19 @@ \alias{exposure} \title{Ego exposure} \usage{ -exposure(graph, cumadopt, attrs = NULL, alt.graph = NULL, +exposure( + graph, + cumadopt, + attrs = NULL, + alt.graph = NULL, outgoing = getOption("diffnet.outgoing", TRUE), - valued = getOption("diffnet.valued", FALSE), normalized = TRUE, - groupvar = NULL, self = getOption("diffnet.self"), lags = 0L, ...) + valued = getOption("diffnet.valued", FALSE), + normalized = TRUE, + groupvar = NULL, + self = getOption("diffnet.self"), + lags = 0L, + ... +) } \arguments{ \item{graph}{A dynamic graph (see \code{\link{netdiffuseR-graphs}}).} @@ -227,13 +236,18 @@ Valente, T. W. (1995). "Network models of the diffusion of innovations" (2nd ed.). Cresskill N.J.: Hampton Press. } \seealso{ -Other statistics: \code{\link{bass}}, - \code{\link{classify_adopters}}, - \code{\link{cumulative_adopt_count}}, \code{\link{dgr}}, - \code{\link{ego_variance}}, \code{\link{hazard_rate}}, - \code{\link{infection}}, \code{\link{moran}}, - \code{\link{struct_equiv}}, \code{\link{threshold}}, - \code{\link{vertex_covariate_dist}} +Other statistics: +\code{\link{bass}}, +\code{\link{classify_adopters}()}, +\code{\link{cumulative_adopt_count}()}, +\code{\link{dgr}()}, +\code{\link{ego_variance}()}, +\code{\link{hazard_rate}()}, +\code{\link{infection}()}, +\code{\link{moran}()}, +\code{\link{struct_equiv}()}, +\code{\link{threshold}()}, +\code{\link{vertex_covariate_dist}()} } \author{ George G. Vega Yon & Thomas W. Valente diff --git a/man/fakeDynEdgelist.Rd b/man/fakeDynEdgelist.Rd index 8b1734d6..77d4cc54 100644 --- a/man/fakeDynEdgelist.Rd +++ b/man/fakeDynEdgelist.Rd @@ -18,13 +18,17 @@ A data frame used for examples in reading edgelist format networks. This edgelist can be merged with the dataset \code{\link{fakesurveyDyn}}. } \seealso{ -Other diffusion datasets: \code{\link{brfarmersDiffNet}}, - \code{\link{brfarmers}}, \code{\link{diffusion-data}}, - \code{\link{fakeEdgelist}}, \code{\link{fakesurveyDyn}}, - \code{\link{fakesurvey}}, \code{\link{kfamilyDiffNet}}, - \code{\link{kfamily}}, - \code{\link{medInnovationsDiffNet}}, - \code{\link{medInnovations}} +Other diffusion datasets: +\code{\link{brfarmersDiffNet}}, +\code{\link{brfarmers}}, +\code{\link{diffusion-data}}, +\code{\link{fakeEdgelist}}, +\code{\link{fakesurveyDyn}}, +\code{\link{fakesurvey}}, +\code{\link{kfamilyDiffNet}}, +\code{\link{kfamily}}, +\code{\link{medInnovationsDiffNet}}, +\code{\link{medInnovations}} } \author{ George G. Vega Yon diff --git a/man/fakeEdgelist.Rd b/man/fakeEdgelist.Rd index a91e2105..b5f937b1 100644 --- a/man/fakeEdgelist.Rd +++ b/man/fakeEdgelist.Rd @@ -17,13 +17,17 @@ A data frame used for examples in reading edgelist format networks. This edgelist can be merged with the dataset \code{\link{fakesurvey}}. } \seealso{ -Other diffusion datasets: \code{\link{brfarmersDiffNet}}, - \code{\link{brfarmers}}, \code{\link{diffusion-data}}, - \code{\link{fakeDynEdgelist}}, - \code{\link{fakesurveyDyn}}, \code{\link{fakesurvey}}, - \code{\link{kfamilyDiffNet}}, \code{\link{kfamily}}, - \code{\link{medInnovationsDiffNet}}, - \code{\link{medInnovations}} +Other diffusion datasets: +\code{\link{brfarmersDiffNet}}, +\code{\link{brfarmers}}, +\code{\link{diffusion-data}}, +\code{\link{fakeDynEdgelist}}, +\code{\link{fakesurveyDyn}}, +\code{\link{fakesurvey}}, +\code{\link{kfamilyDiffNet}}, +\code{\link{kfamily}}, +\code{\link{medInnovationsDiffNet}}, +\code{\link{medInnovations}} } \author{ George G. Vega Yon diff --git a/man/fakesurvey.Rd b/man/fakesurvey.Rd index 127bc948..8fd92bec 100644 --- a/man/fakesurvey.Rd +++ b/man/fakesurvey.Rd @@ -24,13 +24,17 @@ in particular, the \code{\link{survey_to_diffnet}} function. This dataset can be merged with the \code{\link{fakeEdgelist}}. } \seealso{ -Other diffusion datasets: \code{\link{brfarmersDiffNet}}, - \code{\link{brfarmers}}, \code{\link{diffusion-data}}, - \code{\link{fakeDynEdgelist}}, - \code{\link{fakeEdgelist}}, \code{\link{fakesurveyDyn}}, - \code{\link{kfamilyDiffNet}}, \code{\link{kfamily}}, - \code{\link{medInnovationsDiffNet}}, - \code{\link{medInnovations}} +Other diffusion datasets: +\code{\link{brfarmersDiffNet}}, +\code{\link{brfarmers}}, +\code{\link{diffusion-data}}, +\code{\link{fakeDynEdgelist}}, +\code{\link{fakeEdgelist}}, +\code{\link{fakesurveyDyn}}, +\code{\link{kfamilyDiffNet}}, +\code{\link{kfamily}}, +\code{\link{medInnovationsDiffNet}}, +\code{\link{medInnovations}} } \author{ George G. Vega Yon diff --git a/man/fakesurveyDyn.Rd b/man/fakesurveyDyn.Rd index 088b12d9..0422f487 100644 --- a/man/fakesurveyDyn.Rd +++ b/man/fakesurveyDyn.Rd @@ -25,13 +25,17 @@ in particular, the \code{\link{survey_to_diffnet}} function. This dataset can be merged with the \code{\link{fakeDynEdgelist}}. } \seealso{ -Other diffusion datasets: \code{\link{brfarmersDiffNet}}, - \code{\link{brfarmers}}, \code{\link{diffusion-data}}, - \code{\link{fakeDynEdgelist}}, - \code{\link{fakeEdgelist}}, \code{\link{fakesurvey}}, - \code{\link{kfamilyDiffNet}}, \code{\link{kfamily}}, - \code{\link{medInnovationsDiffNet}}, - \code{\link{medInnovations}} +Other diffusion datasets: +\code{\link{brfarmersDiffNet}}, +\code{\link{brfarmers}}, +\code{\link{diffusion-data}}, +\code{\link{fakeDynEdgelist}}, +\code{\link{fakeEdgelist}}, +\code{\link{fakesurvey}}, +\code{\link{kfamilyDiffNet}}, +\code{\link{kfamily}}, +\code{\link{medInnovationsDiffNet}}, +\code{\link{medInnovations}} } \author{ George G. Vega Yon diff --git a/man/grid_distribution.Rd b/man/grid_distribution.Rd index f7a88c70..ae993fbb 100644 --- a/man/grid_distribution.Rd +++ b/man/grid_distribution.Rd @@ -41,13 +41,17 @@ grid_distribution(x,y,20) \seealso{ Used by \code{\link{plot_infectsuscep}} -Other visualizations: \code{\link{dgr}}, - \code{\link{diffusionMap}}, \code{\link{drawColorKey}}, - \code{\link{hazard_rate}}, \code{\link{plot_adopters}}, - \code{\link{plot_diffnet2}}, \code{\link{plot_diffnet}}, - \code{\link{plot_infectsuscep}}, - \code{\link{plot_threshold}}, - \code{\link{rescale_vertex_igraph}} +Other visualizations: +\code{\link{dgr}()}, +\code{\link{diffusionMap}()}, +\code{\link{drawColorKey}()}, +\code{\link{hazard_rate}()}, +\code{\link{plot_adopters}()}, +\code{\link{plot_diffnet2}()}, +\code{\link{plot_diffnet}()}, +\code{\link{plot_infectsuscep}()}, +\code{\link{plot_threshold}()}, +\code{\link{rescale_vertex_igraph}()} } \concept{visualizations} \keyword{dplot} diff --git a/man/hazard_rate.Rd b/man/hazard_rate.Rd index a752d164..a2d2f6e0 100644 --- a/man/hazard_rate.Rd +++ b/man/hazard_rate.Rd @@ -11,10 +11,20 @@ hazard_rate(obj, no.plot = FALSE, include.grid = TRUE, ...) plot_hazard(x, ...) -\method{plot}{diffnet_hr}(x, y = NULL, main = "Hazard Rate", - xlab = "Time", ylab = "Hazard Rate", type = "b", - include.grid = TRUE, bg = "lightblue", pch = 21, add = FALSE, - ylim = c(0, 1), ...) +\method{plot}{diffnet_hr}( + x, + y = NULL, + main = "Hazard Rate", + xlab = "Time", + ylab = "Hazard Rate", + type = "b", + include.grid = TRUE, + bg = "lightblue", + pch = 21, + add = FALSE, + ylim = c(0, 1), + ... +) } \arguments{ \item{obj}{A \eqn{n\times T}{n * T} matrix (Cumulative adoption matrix obtained from @@ -117,22 +127,30 @@ Wooldridge, J. M. (2010). Econometric Analysis of Cross Section and Panel Data (2nd ed.). Cambridge: MIT Press. } \seealso{ -Other statistics: \code{\link{bass}}, - \code{\link{classify_adopters}}, - \code{\link{cumulative_adopt_count}}, \code{\link{dgr}}, - \code{\link{ego_variance}}, \code{\link{exposure}}, - \code{\link{infection}}, \code{\link{moran}}, - \code{\link{struct_equiv}}, \code{\link{threshold}}, - \code{\link{vertex_covariate_dist}} - -Other visualizations: \code{\link{dgr}}, - \code{\link{diffusionMap}}, \code{\link{drawColorKey}}, - \code{\link{grid_distribution}}, - \code{\link{plot_adopters}}, \code{\link{plot_diffnet2}}, - \code{\link{plot_diffnet}}, - \code{\link{plot_infectsuscep}}, - \code{\link{plot_threshold}}, - \code{\link{rescale_vertex_igraph}} +Other statistics: +\code{\link{bass}}, +\code{\link{classify_adopters}()}, +\code{\link{cumulative_adopt_count}()}, +\code{\link{dgr}()}, +\code{\link{ego_variance}()}, +\code{\link{exposure}()}, +\code{\link{infection}()}, +\code{\link{moran}()}, +\code{\link{struct_equiv}()}, +\code{\link{threshold}()}, +\code{\link{vertex_covariate_dist}()} + +Other visualizations: +\code{\link{dgr}()}, +\code{\link{diffusionMap}()}, +\code{\link{drawColorKey}()}, +\code{\link{grid_distribution}()}, +\code{\link{plot_adopters}()}, +\code{\link{plot_diffnet2}()}, +\code{\link{plot_diffnet}()}, +\code{\link{plot_infectsuscep}()}, +\code{\link{plot_threshold}()}, +\code{\link{rescale_vertex_igraph}()} } \author{ George G. Vega Yon & Thomas W. Valente diff --git a/man/igraph.Rd b/man/igraph.Rd index 1d9c5478..3e1c2ca5 100644 --- a/man/igraph.Rd +++ b/man/igraph.Rd @@ -8,8 +8,14 @@ \usage{ diffnet_to_igraph(graph, slices = 1:nslices(graph)) -igraph_to_diffnet(graph = NULL, graph.list = NULL, toavar, t0 = NULL, - t1 = NULL, ...) +igraph_to_diffnet( + graph = NULL, + graph.list = NULL, + toavar, + t0 = NULL, + t1 = NULL, + ... +) } \arguments{ \item{graph}{Either a \code{\link{diffnet}} or \code{\link[igraph:igraph]{igraph}} graph object.} @@ -42,7 +48,9 @@ x <- diffnet_to_igraph(medInnovationsDiffNet) igraph::vertex_attr(x[[1]], "toa") } \seealso{ -Other Foreign: \code{\link{network}}, - \code{\link{read_pajek}}, \code{\link{read_ucinet_head}} +Other Foreign: +\code{\link{network}}, +\code{\link{read_pajek}()}, +\code{\link{read_ucinet_head}()} } \concept{Foreign} diff --git a/man/infection.Rd b/man/infection.Rd index f4a50fa7..67253f5f 100644 --- a/man/infection.Rd +++ b/man/infection.Rd @@ -5,13 +5,29 @@ \alias{susceptibility} \title{Susceptibility and Infection} \usage{ -infection(graph, toa, t0 = NULL, normalize = TRUE, K = 1L, r = 0.5, - expdiscount = FALSE, valued = getOption("diffnet.valued", FALSE), - outgoing = getOption("diffnet.outgoing", TRUE)) - -susceptibility(graph, toa, t0 = NULL, normalize = TRUE, K = 1L, - r = 0.5, expdiscount = FALSE, valued = getOption("diffnet.valued", - FALSE), outgoing = getOption("diffnet.outgoing", TRUE)) +infection( + graph, + toa, + t0 = NULL, + normalize = TRUE, + K = 1L, + r = 0.5, + expdiscount = FALSE, + valued = getOption("diffnet.valued", FALSE), + outgoing = getOption("diffnet.outgoing", TRUE) +) + +susceptibility( + graph, + toa, + t0 = NULL, + normalize = TRUE, + K = 1L, + r = 0.5, + expdiscount = FALSE, + valued = getOption("diffnet.valued", FALSE), + outgoing = getOption("diffnet.outgoing", TRUE) +) } \arguments{ \item{graph}{A dynamic graph (see \code{\link{netdiffuseR-graphs}}).} @@ -129,13 +145,18 @@ Susceptibility, and Mass Media Networks. American Journal of Sociology, 106(1), The user can visualize the distribution of both statistics by using the function \code{\link{plot_infectsuscep}} -Other statistics: \code{\link{bass}}, - \code{\link{classify_adopters}}, - \code{\link{cumulative_adopt_count}}, \code{\link{dgr}}, - \code{\link{ego_variance}}, \code{\link{exposure}}, - \code{\link{hazard_rate}}, \code{\link{moran}}, - \code{\link{struct_equiv}}, \code{\link{threshold}}, - \code{\link{vertex_covariate_dist}} +Other statistics: +\code{\link{bass}}, +\code{\link{classify_adopters}()}, +\code{\link{cumulative_adopt_count}()}, +\code{\link{dgr}()}, +\code{\link{ego_variance}()}, +\code{\link{exposure}()}, +\code{\link{hazard_rate}()}, +\code{\link{moran}()}, +\code{\link{struct_equiv}()}, +\code{\link{threshold}()}, +\code{\link{vertex_covariate_dist}()} } \author{ George G. Vega Yon diff --git a/man/isolated.Rd b/man/isolated.Rd index 9f7539f7..cacd220c 100644 --- a/man/isolated.Rd +++ b/man/isolated.Rd @@ -5,11 +5,17 @@ \alias{drop_isolated} \title{Find and remove isolated vertices} \usage{ -isolated(graph, undirected = getOption("diffnet.undirected", FALSE), - self = getOption("diffnet.self", FALSE)) +isolated( + graph, + undirected = getOption("diffnet.undirected", FALSE), + self = getOption("diffnet.self", FALSE) +) -drop_isolated(graph, undirected = getOption("diffnet.undirected", FALSE), - self = getOption("diffnet.self", FALSE)) +drop_isolated( + graph, + undirected = getOption("diffnet.undirected", FALSE), + self = getOption("diffnet.self", FALSE) +) } \arguments{ \item{graph}{Any class of accepted graph format (see \code{\link{netdiffuseR-graphs}}).} @@ -60,10 +66,11 @@ isolated(graph) drop_isolated(graph) } \seealso{ -Other data management functions: \code{\link{diffnet-class}}, - \code{\link{edgelist_to_adjmat}}, - \code{\link{egonet_attrs}}, - \code{\link{survey_to_diffnet}} +Other data management functions: +\code{\link{diffnet-class}}, +\code{\link{edgelist_to_adjmat}()}, +\code{\link{egonet_attrs}()}, +\code{\link{survey_to_diffnet}()} } \author{ George G. Vega Yon diff --git a/man/kfamily.Rd b/man/kfamily.Rd index af94761d..9fcce779 100644 --- a/man/kfamily.Rd +++ b/man/kfamily.Rd @@ -466,12 +466,16 @@ Valente, T. W. (1995). Network models of the diffusion of innovations (2nd ed.). Cresskill N.J.: Hampton Press. } \seealso{ -Other diffusion datasets: \code{\link{brfarmersDiffNet}}, - \code{\link{brfarmers}}, \code{\link{diffusion-data}}, - \code{\link{fakeDynEdgelist}}, - \code{\link{fakeEdgelist}}, \code{\link{fakesurveyDyn}}, - \code{\link{fakesurvey}}, \code{\link{kfamilyDiffNet}}, - \code{\link{medInnovationsDiffNet}}, - \code{\link{medInnovations}} +Other diffusion datasets: +\code{\link{brfarmersDiffNet}}, +\code{\link{brfarmers}}, +\code{\link{diffusion-data}}, +\code{\link{fakeDynEdgelist}}, +\code{\link{fakeEdgelist}}, +\code{\link{fakesurveyDyn}}, +\code{\link{fakesurvey}}, +\code{\link{kfamilyDiffNet}}, +\code{\link{medInnovationsDiffNet}}, +\code{\link{medInnovations}} } \concept{diffusion datasets} diff --git a/man/kfamilyDiffNet.Rd b/man/kfamilyDiffNet.Rd index 564d9e44..d9a5b6a7 100644 --- a/man/kfamilyDiffNet.Rd +++ b/man/kfamilyDiffNet.Rd @@ -9,12 +9,16 @@ A directed dynamic graph with 1,047 vertices and 11 time periods. The attributes in the graph are static and described in \code{\link{kfamily}}. } \seealso{ -Other diffusion datasets: \code{\link{brfarmersDiffNet}}, - \code{\link{brfarmers}}, \code{\link{diffusion-data}}, - \code{\link{fakeDynEdgelist}}, - \code{\link{fakeEdgelist}}, \code{\link{fakesurveyDyn}}, - \code{\link{fakesurvey}}, \code{\link{kfamily}}, - \code{\link{medInnovationsDiffNet}}, - \code{\link{medInnovations}} +Other diffusion datasets: +\code{\link{brfarmersDiffNet}}, +\code{\link{brfarmers}}, +\code{\link{diffusion-data}}, +\code{\link{fakeDynEdgelist}}, +\code{\link{fakeEdgelist}}, +\code{\link{fakesurveyDyn}}, +\code{\link{fakesurvey}}, +\code{\link{kfamily}}, +\code{\link{medInnovationsDiffNet}}, +\code{\link{medInnovations}} } \concept{diffusion datasets} diff --git a/man/matrix_compare.Rd b/man/matrix_compare.Rd index f6d59a22..6bca4259 100644 --- a/man/matrix_compare.Rd +++ b/man/matrix_compare.Rd @@ -97,7 +97,8 @@ microbenchmark::microbenchmark( } } \seealso{ -Other dyadic-level comparison functions: \code{\link{vertex_covariate_compare}}, - \code{\link{vertex_covariate_dist}} +Other dyadic-level comparison functions: +\code{\link{vertex_covariate_compare}()}, +\code{\link{vertex_covariate_dist}()} } \concept{dyadic-level comparison functions} diff --git a/man/medInnovations.Rd b/man/medInnovations.Rd index 3138c07d..ce70f6c1 100644 --- a/man/medInnovations.Rd +++ b/man/medInnovations.Rd @@ -92,12 +92,16 @@ Valente, T. W. (1995). Network models of the diffusion of innovations (2nd ed.). Cresskill N.J.: Hampton Press. } \seealso{ -Other diffusion datasets: \code{\link{brfarmersDiffNet}}, - \code{\link{brfarmers}}, \code{\link{diffusion-data}}, - \code{\link{fakeDynEdgelist}}, - \code{\link{fakeEdgelist}}, \code{\link{fakesurveyDyn}}, - \code{\link{fakesurvey}}, \code{\link{kfamilyDiffNet}}, - \code{\link{kfamily}}, - \code{\link{medInnovationsDiffNet}} +Other diffusion datasets: +\code{\link{brfarmersDiffNet}}, +\code{\link{brfarmers}}, +\code{\link{diffusion-data}}, +\code{\link{fakeDynEdgelist}}, +\code{\link{fakeEdgelist}}, +\code{\link{fakesurveyDyn}}, +\code{\link{fakesurvey}}, +\code{\link{kfamilyDiffNet}}, +\code{\link{kfamily}}, +\code{\link{medInnovationsDiffNet}} } \concept{diffusion datasets} diff --git a/man/medInnovationsDiffNet.Rd b/man/medInnovationsDiffNet.Rd index c3e04a2b..2fd4e295 100644 --- a/man/medInnovationsDiffNet.Rd +++ b/man/medInnovationsDiffNet.Rd @@ -9,11 +9,16 @@ A directed dynamic graph with 125 vertices and 18 time periods. The attributes in the graph are static and described in \code{\link{medInnovations}}. } \seealso{ -Other diffusion datasets: \code{\link{brfarmersDiffNet}}, - \code{\link{brfarmers}}, \code{\link{diffusion-data}}, - \code{\link{fakeDynEdgelist}}, - \code{\link{fakeEdgelist}}, \code{\link{fakesurveyDyn}}, - \code{\link{fakesurvey}}, \code{\link{kfamilyDiffNet}}, - \code{\link{kfamily}}, \code{\link{medInnovations}} +Other diffusion datasets: +\code{\link{brfarmersDiffNet}}, +\code{\link{brfarmers}}, +\code{\link{diffusion-data}}, +\code{\link{fakeDynEdgelist}}, +\code{\link{fakeEdgelist}}, +\code{\link{fakesurveyDyn}}, +\code{\link{fakesurvey}}, +\code{\link{kfamilyDiffNet}}, +\code{\link{kfamily}}, +\code{\link{medInnovations}} } \concept{diffusion datasets} diff --git a/man/mentor_matching.Rd b/man/mentor_matching.Rd index 125507bc..0365b3eb 100644 --- a/man/mentor_matching.Rd +++ b/man/mentor_matching.Rd @@ -6,17 +6,33 @@ \alias{plot.diffnet_mentor} \title{Optimal Leader/Mentor Matching} \usage{ -mentor_matching(graph, n, cmode = "indegree", - lead.ties.method = "average", geodist.args = list()) - -leader_matching(graph, n, cmode = "indegree", - lead.ties.method = "average", geodist.args = list()) - -\method{plot}{diffnet_mentor}(x, y = NULL, vertex.size = "degree", - minmax.relative.size = getOption("diffnet.minmax.relative.size", - c(0.01, 0.04)), lead.cols = grDevices::topo.colors(attr(x, - "nleaders")), vshapes = c(Leader = "square", Follower = "circle"), - add.legend = TRUE, main = "Mentoring Network", ...) +mentor_matching( + graph, + n, + cmode = "indegree", + lead.ties.method = "average", + geodist.args = list() +) + +leader_matching( + graph, + n, + cmode = "indegree", + lead.ties.method = "average", + geodist.args = list() +) + +\method{plot}{diffnet_mentor}( + x, + y = NULL, + vertex.size = "degree", + minmax.relative.size = getOption("diffnet.minmax.relative.size", c(0.01, 0.04)), + lead.cols = grDevices::topo.colors(attr(x, "nleaders")), + vshapes = c(Leader = "square", Follower = "circle"), + add.legend = TRUE, + main = "Mentoring Network", + ... +) } \arguments{ \item{graph}{Any class of accepted graph format (see \code{\link{netdiffuseR-graphs}}).} diff --git a/man/moran.Rd b/man/moran.Rd index 76cd4947..e302e456 100644 --- a/man/moran.Rd +++ b/man/moran.Rd @@ -61,16 +61,22 @@ Moran's I. (2015, September 3). In Wikipedia, The Free Encyclopedia. Retrieved 06:23, December 22, 2015, from \url{https://en.wikipedia.org/w/index.php?title=Moran\%27s_I&oldid=679297766} } \seealso{ -Other statistics: \code{\link{bass}}, - \code{\link{classify_adopters}}, - \code{\link{cumulative_adopt_count}}, \code{\link{dgr}}, - \code{\link{ego_variance}}, \code{\link{exposure}}, - \code{\link{hazard_rate}}, \code{\link{infection}}, - \code{\link{struct_equiv}}, \code{\link{threshold}}, - \code{\link{vertex_covariate_dist}} +Other statistics: +\code{\link{bass}}, +\code{\link{classify_adopters}()}, +\code{\link{cumulative_adopt_count}()}, +\code{\link{dgr}()}, +\code{\link{ego_variance}()}, +\code{\link{exposure}()}, +\code{\link{hazard_rate}()}, +\code{\link{infection}()}, +\code{\link{struct_equiv}()}, +\code{\link{threshold}()}, +\code{\link{vertex_covariate_dist}()} -Other Functions for inference: \code{\link{bootnet}}, - \code{\link{struct_test}} +Other Functions for inference: +\code{\link{bootnet}()}, +\code{\link{struct_test}()} } \author{ George G. Vega Yon diff --git a/man/netdiffuseR.Rd b/man/netdiffuseR.Rd index c4165031..7151b65f 100644 --- a/man/netdiffuseR.Rd +++ b/man/netdiffuseR.Rd @@ -3,7 +3,6 @@ \docType{package} \name{netdiffuseR} \alias{netdiffuseR} -\alias{netdiffuseR-package} \title{netdiffuseR} \description{ Statistical analysis, visualization and simulation of diffusion and contagion diff --git a/man/netmatch.Rd b/man/netmatch.Rd index 986a0d4a..cd2af57d 100644 --- a/man/netmatch.Rd +++ b/man/netmatch.Rd @@ -5,13 +5,30 @@ \alias{netmatch_prepare} \title{Matching Estimators with Network Data} \usage{ -netmatch_prepare(dat, graph, timevar, depvar, covariates, - treat_thr = rep(1L, length(graph)), adopt_thr = rep(1L, - length(graph)), expo_pcent = FALSE, expo_lag = 0L) - -netmatch(dat, graph, timevar, depvar, covariates, treat_thr = rep(1L, - length(graph)), adopt_thr = rep(1L, length(graph)), - expo_pcent = FALSE, expo_lag = 0L, ...) +netmatch_prepare( + dat, + graph, + timevar, + depvar, + covariates, + treat_thr = rep(1L, length(graph)), + adopt_thr = rep(1L, length(graph)), + expo_pcent = FALSE, + expo_lag = 0L +) + +netmatch( + dat, + graph, + timevar, + depvar, + covariates, + treat_thr = rep(1L, length(graph)), + adopt_thr = rep(1L, length(graph)), + expo_pcent = FALSE, + expo_lag = 0L, + ... +) } \arguments{ \item{dat}{\code{data.frame} with dynamic data. Must be of diff --git a/man/network.Rd b/man/network.Rd index 3a1539d6..80bbcd7e 100644 --- a/man/network.Rd +++ b/man/network.Rd @@ -11,13 +11,22 @@ \usage{ diffnet_to_network(graph, slices = 1:nslices(graph), ...) -diffnet_to_networkDynamic(graph, slices = 1:nslices(graph), - diffnet2net.args = list(), netdyn.args = list()) +diffnet_to_networkDynamic( + graph, + slices = 1:nslices(graph), + diffnet2net.args = list(), + netdyn.args = list() +) networkDynamic_to_diffnet(graph, toavar) -network_to_diffnet(graph = NULL, graph.list = NULL, toavar, - t0 = NULL, t1 = NULL) +network_to_diffnet( + graph = NULL, + graph.list = NULL, + toavar, + t0 = NULL, + t1 = NULL +) } \arguments{ \item{graph}{An object of class \code{\link{diffnet}}} @@ -99,7 +108,9 @@ networkDynamic_to_diffnet(ans, toavar = "toa") } \seealso{ -Other Foreign: \code{\link{igraph}}, - \code{\link{read_pajek}}, \code{\link{read_ucinet_head}} +Other Foreign: +\code{\link{igraph}}, +\code{\link{read_pajek}()}, +\code{\link{read_ucinet_head}()} } \concept{Foreign} diff --git a/man/permute_graph.Rd b/man/permute_graph.Rd index 2c54314a..39910371 100644 --- a/man/permute_graph.Rd +++ b/man/permute_graph.Rd @@ -57,10 +57,13 @@ regression approach. Cancer Research, 27(2), 209–20. \seealso{ This function can be used as null distribution in \code{struct_test} -Other simulation functions: \code{\link{rdiffnet}}, - \code{\link{rewire_graph}}, \code{\link{rgraph_ba}}, - \code{\link{rgraph_er}}, \code{\link{rgraph_ws}}, - \code{\link{ring_lattice}} +Other simulation functions: +\code{\link{rdiffnet}()}, +\code{\link{rewire_graph}()}, +\code{\link{rgraph_ba}()}, +\code{\link{rgraph_er}()}, +\code{\link{rgraph_ws}()}, +\code{\link{ring_lattice}()} } \author{ George G. Vega Yon diff --git a/man/plot.diffnet.Rd b/man/plot.diffnet.Rd index 8c9f9212..5e9d9ea0 100644 --- a/man/plot.diffnet.Rd +++ b/man/plot.diffnet.Rd @@ -4,11 +4,16 @@ \alias{plot.diffnet} \title{S3 plotting method for diffnet objects.} \usage{ -\method{plot}{diffnet}(x, y = NULL, t = 1, vertex.color = c(adopt = - "steelblue", noadopt = "white"), vertex.size = "degree", +\method{plot}{diffnet}( + x, + y = NULL, + t = 1, + vertex.color = c(adopt = "steelblue", noadopt = "white"), + vertex.size = "degree", main = "Diffusion network in time \%d", - minmax.relative.size = getOption("diffnet.minmax.relative.size", - c(0.01, 0.04)), ...) + minmax.relative.size = getOption("diffnet.minmax.relative.size", c(0.01, 0.04)), + ... +) } \arguments{ \item{x}{An object of class \code{\link[=diffnet-class]{diffnet}}} @@ -54,11 +59,14 @@ plot(medInnovationsDiffNet) } \seealso{ -Other diffnet methods: \code{\link{\%*\%}}, - \code{\link{as.array.diffnet}}, \code{\link{c.diffnet}}, - \code{\link{diffnet-arithmetic}}, - \code{\link{diffnet-class}}, \code{\link{diffnet_index}}, - \code{\link{summary.diffnet}} +Other diffnet methods: +\code{\link{\%*\%}()}, +\code{\link{as.array.diffnet}()}, +\code{\link{c.diffnet}()}, +\code{\link{diffnet-arithmetic}}, +\code{\link{diffnet-class}}, +\code{\link{diffnet_index}}, +\code{\link{summary.diffnet}()} } \author{ George G. Vega Yon diff --git a/man/plot_adopters.Rd b/man/plot_adopters.Rd index ddec5410..0b8dd138 100644 --- a/man/plot_adopters.Rd +++ b/man/plot_adopters.Rd @@ -4,12 +4,24 @@ \alias{plot_adopters} \title{Visualize adopters and cumulative adopters} \usage{ -plot_adopters(obj, freq = FALSE, what = c("adopt", "cumadopt"), - add = FALSE, include.legend = TRUE, include.grid = TRUE, - pch = c(21, 24), type = c("b", "b"), ylim = if (!freq) c(0, 1) else - NULL, lty = c(1, 1), col = c("black", "black"), bg = c("tomato", - "gray"), xlab = "Time", ylab = ifelse(freq, "Frequency", - "Proportion"), main = "Adopters and Cumulative Adopters", ...) +plot_adopters( + obj, + freq = FALSE, + what = c("adopt", "cumadopt"), + add = FALSE, + include.legend = TRUE, + include.grid = TRUE, + pch = c(21, 24), + type = c("b", "b"), + ylim = if (!freq) c(0, 1) else NULL, + lty = c(1, 1), + col = c("black", "black"), + bg = c("tomato", "gray"), + xlab = "Time", + ylab = ifelse(freq, "Frequency", "Proportion"), + main = "Adopters and Cumulative Adopters", + ... +) } \arguments{ \item{obj}{Either a diffnet object or a cumulative a doption matrix.} @@ -63,14 +75,17 @@ mat <- toa_mat(toa) plot_adopters(mat$cumadopt) } \seealso{ -Other visualizations: \code{\link{dgr}}, - \code{\link{diffusionMap}}, \code{\link{drawColorKey}}, - \code{\link{grid_distribution}}, - \code{\link{hazard_rate}}, \code{\link{plot_diffnet2}}, - \code{\link{plot_diffnet}}, - \code{\link{plot_infectsuscep}}, - \code{\link{plot_threshold}}, - \code{\link{rescale_vertex_igraph}} +Other visualizations: +\code{\link{dgr}()}, +\code{\link{diffusionMap}()}, +\code{\link{drawColorKey}()}, +\code{\link{grid_distribution}()}, +\code{\link{hazard_rate}()}, +\code{\link{plot_diffnet2}()}, +\code{\link{plot_diffnet}()}, +\code{\link{plot_infectsuscep}()}, +\code{\link{plot_threshold}()}, +\code{\link{rescale_vertex_igraph}()} } \author{ George G. Vega Yon diff --git a/man/plot_diffnet.Rd b/man/plot_diffnet.Rd index daea7114..8f3712a0 100644 --- a/man/plot_diffnet.Rd +++ b/man/plot_diffnet.Rd @@ -10,14 +10,20 @@ plot_diffnet(...) \method{plot_diffnet}{diffnet}(graph, ...) -\method{plot_diffnet}{default}(graph, cumadopt, slices = NULL, +\method{plot_diffnet}{default}( + graph, + cumadopt, + slices = NULL, vertex.color = c("white", "tomato", "steelblue"), vertex.shape = c("square", "circle", "circle"), - vertex.size = "degree", mfrow.par = NULL, + vertex.size = "degree", + mfrow.par = NULL, main = c("Network in period \%s", "Diffusion Network"), legend.args = list(), - minmax.relative.size = getOption("diffnet.minmax.relative.size", - c(0.01, 0.04)), background = NULL, ...) + minmax.relative.size = getOption("diffnet.minmax.relative.size", c(0.01, 0.04)), + background = NULL, + ... +) } \arguments{ \item{...}{Further arguments to be passed to \code{\link[igraph:plot.igraph]{plot.igraph}}.} @@ -104,14 +110,17 @@ adopt <- toa_mat(toa) plot_diffnet(graph, adopt$cumadopt) } \seealso{ -Other visualizations: \code{\link{dgr}}, - \code{\link{diffusionMap}}, \code{\link{drawColorKey}}, - \code{\link{grid_distribution}}, - \code{\link{hazard_rate}}, \code{\link{plot_adopters}}, - \code{\link{plot_diffnet2}}, - \code{\link{plot_infectsuscep}}, - \code{\link{plot_threshold}}, - \code{\link{rescale_vertex_igraph}} +Other visualizations: +\code{\link{dgr}()}, +\code{\link{diffusionMap}()}, +\code{\link{drawColorKey}()}, +\code{\link{grid_distribution}()}, +\code{\link{hazard_rate}()}, +\code{\link{plot_adopters}()}, +\code{\link{plot_diffnet2}()}, +\code{\link{plot_infectsuscep}()}, +\code{\link{plot_threshold}()}, +\code{\link{rescale_vertex_igraph}()} } \author{ George G. Vega Yon diff --git a/man/plot_diffnet2.Rd b/man/plot_diffnet2.Rd index c2486d29..fb77b797 100644 --- a/man/plot_diffnet2.Rd +++ b/man/plot_diffnet2.Rd @@ -10,15 +10,24 @@ plot_diffnet2(graph, ...) \method{plot_diffnet2}{diffnet}(graph, toa, slice = nslices(graph), ...) -\method{plot_diffnet2}{default}(graph, toa, pers = min(toa, na.rm = - TRUE):max(toa, na.rm = TRUE), +\method{plot_diffnet2}{default}( + graph, + toa, + pers = min(toa, na.rm = TRUE):max(toa, na.rm = TRUE), color.ramp = grDevices::colorRamp(viridisLite::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, ...) + 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, + ... +) } \arguments{ \item{graph}{Any class of accepted graph format (see \code{\link{netdiffuseR-graphs}}).} @@ -96,14 +105,17 @@ By defult, the function passes the following values to \code{plot.igraph}: } } \seealso{ -Other visualizations: \code{\link{dgr}}, - \code{\link{diffusionMap}}, \code{\link{drawColorKey}}, - \code{\link{grid_distribution}}, - \code{\link{hazard_rate}}, \code{\link{plot_adopters}}, - \code{\link{plot_diffnet}}, - \code{\link{plot_infectsuscep}}, - \code{\link{plot_threshold}}, - \code{\link{rescale_vertex_igraph}} +Other visualizations: +\code{\link{dgr}()}, +\code{\link{diffusionMap}()}, +\code{\link{drawColorKey}()}, +\code{\link{grid_distribution}()}, +\code{\link{hazard_rate}()}, +\code{\link{plot_adopters}()}, +\code{\link{plot_diffnet}()}, +\code{\link{plot_infectsuscep}()}, +\code{\link{plot_threshold}()}, +\code{\link{rescale_vertex_igraph}()} } \author{ George G. Vega Yon diff --git a/man/plot_infectsuscep.Rd b/man/plot_infectsuscep.Rd index 5238225e..4d9cf474 100644 --- a/man/plot_infectsuscep.Rd +++ b/man/plot_infectsuscep.Rd @@ -4,15 +4,28 @@ \alias{plot_infectsuscep} \title{Plot distribution of infect/suscep} \usage{ -plot_infectsuscep(graph, toa, t0 = NULL, normalize = TRUE, K = 1L, - r = 0.5, expdiscount = FALSE, bins = 20, nlevels = round(bins/2), - h = NULL, logscale = TRUE, +plot_infectsuscep( + graph, + toa, + t0 = NULL, + normalize = TRUE, + K = 1L, + r = 0.5, + expdiscount = FALSE, + bins = 20, + nlevels = round(bins/2), + h = NULL, + logscale = TRUE, main = "Distribution of Infectiousness and\\nSusceptibility", - xlab = "Infectiousness of ego", ylab = "Susceptibility of ego", + xlab = "Infectiousness of ego", + ylab = "Susceptibility of ego", sub = ifelse(logscale, "(in log-scale)", NA), color.palette = function(n) viridisLite::viridis(n), - include.grid = TRUE, exclude.zeros = FALSE, - valued = getOption("diffnet.valued", FALSE), ...) + include.grid = TRUE, + exclude.zeros = FALSE, + valued = getOption("diffnet.valued", FALSE), + ... +) } \arguments{ \item{graph}{A dynamic graph (see \code{\link{netdiffuseR-graphs}}).} @@ -99,13 +112,17 @@ of Social Networks". Science, 337(6092), 337–341. Infectiousness and susceptibility are computed via \code{\link{infection}} and \code{\link{susceptibility}}. -Other visualizations: \code{\link{dgr}}, - \code{\link{diffusionMap}}, \code{\link{drawColorKey}}, - \code{\link{grid_distribution}}, - \code{\link{hazard_rate}}, \code{\link{plot_adopters}}, - \code{\link{plot_diffnet2}}, \code{\link{plot_diffnet}}, - \code{\link{plot_threshold}}, - \code{\link{rescale_vertex_igraph}} +Other visualizations: +\code{\link{dgr}()}, +\code{\link{diffusionMap}()}, +\code{\link{drawColorKey}()}, +\code{\link{grid_distribution}()}, +\code{\link{hazard_rate}()}, +\code{\link{plot_adopters}()}, +\code{\link{plot_diffnet2}()}, +\code{\link{plot_diffnet}()}, +\code{\link{plot_threshold}()}, +\code{\link{rescale_vertex_igraph}()} } \author{ George G. Vega Yon diff --git a/man/plot_threshold.Rd b/man/plot_threshold.Rd index fc3fd5c1..29c08f74 100644 --- a/man/plot_threshold.Rd +++ b/man/plot_threshold.Rd @@ -13,20 +13,43 @@ plot_threshold(graph, expo, ...) \method{plot_threshold}{array}(graph, expo, ...) -\method{plot_threshold}{default}(graph, expo, toa, - include_censored = FALSE, t0 = min(toa, na.rm = TRUE), - attrs = NULL, undirected = getOption("diffnet.undirected"), +\method{plot_threshold}{default}( + graph, + expo, + toa, + include_censored = FALSE, + t0 = min(toa, na.rm = TRUE), + attrs = NULL, + undirected = getOption("diffnet.undirected"), no.contemporary = TRUE, - main = "Time of Adoption by\\nNetwork Threshold", xlab = "Time", - ylab = "Threshold", vertex.size = "degree", vertex.color = NULL, - vertex.label = "", vertex.label.pos = NULL, vertex.label.cex = 1, - vertex.label.adj = c(0.5, 0.5), vertex.label.color = NULL, - vertex.sides = 40L, vertex.rot = 0, edge.width = 2, - edge.color = NULL, arrow.width = NULL, arrow.length = NULL, - arrow.color = NULL, include.grid = FALSE, - vertex.frame.color = NULL, bty = "n", jitter.factor = c(1, 1), - jitter.amount = c(0.25, 0.025), xlim = NULL, ylim = NULL, - edge.curved = NULL, background = NULL, ...) + main = "Time of Adoption by\\nNetwork Threshold", + xlab = "Time", + ylab = "Threshold", + vertex.size = "degree", + vertex.color = NULL, + vertex.label = "", + vertex.label.pos = NULL, + vertex.label.cex = 1, + vertex.label.adj = c(0.5, 0.5), + vertex.label.color = NULL, + vertex.sides = 40L, + vertex.rot = 0, + edge.width = 2, + edge.color = NULL, + arrow.width = NULL, + arrow.length = NULL, + arrow.color = NULL, + include.grid = FALSE, + vertex.frame.color = NULL, + bty = "n", + jitter.factor = c(1, 1), + jitter.amount = c(0.25, 0.025), + xlim = NULL, + ylim = NULL, + edge.curved = NULL, + background = NULL, + ... +) } \arguments{ \item{graph}{A dynamic graph (see \code{\link{netdiffuseR-graphs}}).} @@ -138,13 +161,17 @@ plot_threshold(graph, expos, toa, vertex.size = "indegree") Use \code{\link{threshold}} to retrieve the corresponding threshold obtained returned by \code{\link{exposure}}. -Other visualizations: \code{\link{dgr}}, - \code{\link{diffusionMap}}, \code{\link{drawColorKey}}, - \code{\link{grid_distribution}}, - \code{\link{hazard_rate}}, \code{\link{plot_adopters}}, - \code{\link{plot_diffnet2}}, \code{\link{plot_diffnet}}, - \code{\link{plot_infectsuscep}}, - \code{\link{rescale_vertex_igraph}} +Other visualizations: +\code{\link{dgr}()}, +\code{\link{diffusionMap}()}, +\code{\link{drawColorKey}()}, +\code{\link{grid_distribution}()}, +\code{\link{hazard_rate}()}, +\code{\link{plot_adopters}()}, +\code{\link{plot_diffnet2}()}, +\code{\link{plot_diffnet}()}, +\code{\link{plot_infectsuscep}()}, +\code{\link{rescale_vertex_igraph}()} } \author{ George G. Vega Yon diff --git a/man/rdiffnet.Rd b/man/rdiffnet.Rd index 5dfe71e8..8abb1b0e 100644 --- a/man/rdiffnet.Rd +++ b/man/rdiffnet.Rd @@ -7,11 +7,21 @@ \usage{ rdiffnet_multiple(R, statistic, ..., ncpus = 1L, cl = NULL) -rdiffnet(n, t, seed.nodes = "random", seed.p.adopt = 0.05, - seed.graph = "scale-free", rgraph.args = list(), rewire = TRUE, - rewire.args = list(), threshold.dist = runif(n), - exposure.args = list(), name = "A diffusion network", - behavior = "Random contagion", stop.no.diff = TRUE) +rdiffnet( + n, + t, + seed.nodes = "random", + seed.p.adopt = 0.05, + seed.graph = "scale-free", + rgraph.args = list(), + rewire = TRUE, + rewire.args = list(), + threshold.dist = runif(n), + exposure.args = list(), + name = "A diffusion network", + behavior = "Random contagion", + stop.no.diff = TRUE +) } \arguments{ \item{R}{Integer scalar. Number of simulations to be done.} @@ -176,10 +186,13 @@ ans1 <- rdiffnet_multiple(R=50, statistic=function(x) sum(!is.na(x$toa)), boxplot(cbind(Random = ans0, Central = ans1), main="Number of adopters") } \seealso{ -Other simulation functions: \code{\link{permute_graph}}, - \code{\link{rewire_graph}}, \code{\link{rgraph_ba}}, - \code{\link{rgraph_er}}, \code{\link{rgraph_ws}}, - \code{\link{ring_lattice}} +Other simulation functions: +\code{\link{permute_graph}()}, +\code{\link{rewire_graph}()}, +\code{\link{rgraph_ba}()}, +\code{\link{rgraph_er}()}, +\code{\link{rgraph_ws}()}, +\code{\link{ring_lattice}()} } \author{ George G. Vega Yon diff --git a/man/read_pajek.Rd b/man/read_pajek.Rd index 927f4357..e7254484 100644 --- a/man/read_pajek.Rd +++ b/man/read_pajek.Rd @@ -61,8 +61,10 @@ SAMPSONL <- read_ml(path) } \seealso{ -Other Foreign: \code{\link{igraph}}, \code{\link{network}}, - \code{\link{read_ucinet_head}} +Other Foreign: +\code{\link{igraph}}, +\code{\link{network}}, +\code{\link{read_ucinet_head}()} } \author{ George G. Vega Yon diff --git a/man/read_ucinet_head.Rd b/man/read_ucinet_head.Rd index e42d4225..55225128 100644 --- a/man/read_ucinet_head.Rd +++ b/man/read_ucinet_head.Rd @@ -35,7 +35,9 @@ Reads UCINET files Read UCINET files (binary) } \seealso{ -Other Foreign: \code{\link{igraph}}, \code{\link{network}}, - \code{\link{read_pajek}} +Other Foreign: +\code{\link{igraph}}, +\code{\link{network}}, +\code{\link{read_pajek}()} } \concept{Foreign} diff --git a/man/rescale_vertex_igraph.Rd b/man/rescale_vertex_igraph.Rd index a5ab49d0..d2901adc 100644 --- a/man/rescale_vertex_igraph.Rd +++ b/man/rescale_vertex_igraph.Rd @@ -6,17 +6,26 @@ \alias{vertex_rescale_igraph} \title{Rescale vertex size to be used in \code{\link[igraph:plot.igraph]{plot.igraph}}.} \usage{ -rescale_vertex_igraph(vertex.size, par.usr = par("usr"), - minmax.relative.size = getOption("diffnet.minmax.relative.size", - c(0.01, 0.04)), adjust = 200) - -igraph_vertex_rescale(vertex.size, par.usr = par("usr"), - minmax.relative.size = getOption("diffnet.minmax.relative.size", - c(0.01, 0.04)), adjust = 200) - -vertex_rescale_igraph(vertex.size, par.usr = par("usr"), - minmax.relative.size = getOption("diffnet.minmax.relative.size", - c(0.01, 0.04)), adjust = 200) +rescale_vertex_igraph( + vertex.size, + par.usr = par("usr"), + minmax.relative.size = getOption("diffnet.minmax.relative.size", c(0.01, 0.04)), + adjust = 200 +) + +igraph_vertex_rescale( + vertex.size, + par.usr = par("usr"), + minmax.relative.size = getOption("diffnet.minmax.relative.size", c(0.01, 0.04)), + adjust = 200 +) + +vertex_rescale_igraph( + vertex.size, + par.usr = par("usr"), + minmax.relative.size = getOption("diffnet.minmax.relative.size", c(0.01, 0.04)), + adjust = 200 +) } \arguments{ \item{vertex.size}{Numeric vector of unscaled vertices' sizes. This is unit-free.} @@ -105,13 +114,17 @@ par(oldpar) } \seealso{ -Other visualizations: \code{\link{dgr}}, - \code{\link{diffusionMap}}, \code{\link{drawColorKey}}, - \code{\link{grid_distribution}}, - \code{\link{hazard_rate}}, \code{\link{plot_adopters}}, - \code{\link{plot_diffnet2}}, \code{\link{plot_diffnet}}, - \code{\link{plot_infectsuscep}}, - \code{\link{plot_threshold}} +Other visualizations: +\code{\link{dgr}()}, +\code{\link{diffusionMap}()}, +\code{\link{drawColorKey}()}, +\code{\link{grid_distribution}()}, +\code{\link{hazard_rate}()}, +\code{\link{plot_adopters}()}, +\code{\link{plot_diffnet2}()}, +\code{\link{plot_diffnet}()}, +\code{\link{plot_infectsuscep}()}, +\code{\link{plot_threshold}()} } \author{ George G. Vega Yon diff --git a/man/rewire_graph.Rd b/man/rewire_graph.Rd index 71e0d583..ee0cbd02 100644 --- a/man/rewire_graph.Rd +++ b/man/rewire_graph.Rd @@ -4,11 +4,18 @@ \alias{rewire_graph} \title{Graph rewiring algorithms} \usage{ -rewire_graph(graph, p, algorithm = "endpoints", both.ends = FALSE, - self = FALSE, multiple = FALSE, +rewire_graph( + graph, + p, + algorithm = "endpoints", + both.ends = FALSE, + self = FALSE, + multiple = FALSE, undirected = getOption("diffnet.undirected"), - pr.change = ifelse(self, 0.5, 1), copy.first = TRUE, - althexagons = FALSE) + pr.change = ifelse(self, 0.5, 1), + copy.first = TRUE, + althexagons = FALSE +) } \arguments{ \item{graph}{Any class of accepted graph format (see \code{\link{netdiffuseR-graphs}}).} @@ -216,10 +223,13 @@ prescribed joint degree distribution. Journal of Experimental Algorithmics, 17(1), 3.1. \url{http://doi.org/10.1145/2133803.2330086} } \seealso{ -Other simulation functions: \code{\link{permute_graph}}, - \code{\link{rdiffnet}}, \code{\link{rgraph_ba}}, - \code{\link{rgraph_er}}, \code{\link{rgraph_ws}}, - \code{\link{ring_lattice}} +Other simulation functions: +\code{\link{permute_graph}()}, +\code{\link{rdiffnet}()}, +\code{\link{rgraph_ba}()}, +\code{\link{rgraph_er}()}, +\code{\link{rgraph_ws}()}, +\code{\link{ring_lattice}()} } \author{ George G. Vega Yon diff --git a/man/rgraph_ba.Rd b/man/rgraph_ba.Rd index 2822745a..62526685 100644 --- a/man/rgraph_ba.Rd +++ b/man/rgraph_ba.Rd @@ -5,8 +5,7 @@ \alias{scale-free} \title{Scale-free and Homophilic Random Networks} \usage{ -rgraph_ba(m0 = 1L, m = 1L, t = 10L, graph = NULL, self = TRUE, - eta = NULL) +rgraph_ba(m0 = 1L, m = 1L, t = 10L, graph = NULL, self = TRUE, eta = NULL) } \arguments{ \item{m0}{Integer scalar. Number of initial vertices in the graph.} @@ -104,10 +103,13 @@ Scale-free homophilic network. European Physical Journal B, 86(2). \url{http://doi.org/10.1140/epjb/e2012-30802-x} } \seealso{ -Other simulation functions: \code{\link{permute_graph}}, - \code{\link{rdiffnet}}, \code{\link{rewire_graph}}, - \code{\link{rgraph_er}}, \code{\link{rgraph_ws}}, - \code{\link{ring_lattice}} +Other simulation functions: +\code{\link{permute_graph}()}, +\code{\link{rdiffnet}()}, +\code{\link{rewire_graph}()}, +\code{\link{rgraph_er}()}, +\code{\link{rgraph_ws}()}, +\code{\link{ring_lattice}()} } \author{ George G. Vega Yon diff --git a/man/rgraph_er.Rd b/man/rgraph_er.Rd index 861296e4..a6241997 100644 --- a/man/rgraph_er.Rd +++ b/man/rgraph_er.Rd @@ -5,9 +5,15 @@ \alias{bernoulli} \title{Erdos-Renyi model} \usage{ -rgraph_er(n = 10, t = 1, p = 0.01, - undirected = getOption("diffnet.undirected"), weighted = FALSE, - self = getOption("diffnet.self"), as.edgelist = FALSE) +rgraph_er( + n = 10, + t = 1, + p = 0.01, + undirected = getOption("diffnet.undirected"), + weighted = FALSE, + self = getOption("diffnet.self"), + as.edgelist = FALSE +) } \arguments{ \item{n}{Integer. Number of vertices} @@ -70,10 +76,13 @@ Barabasi, Albert-Laszlo. "Network science book" Retrieved November 1 (2015) \url{http://barabasi.com/book/network-science}. } \seealso{ -Other simulation functions: \code{\link{permute_graph}}, - \code{\link{rdiffnet}}, \code{\link{rewire_graph}}, - \code{\link{rgraph_ba}}, \code{\link{rgraph_ws}}, - \code{\link{ring_lattice}} +Other simulation functions: +\code{\link{permute_graph}()}, +\code{\link{rdiffnet}()}, +\code{\link{rewire_graph}()}, +\code{\link{rgraph_ba}()}, +\code{\link{rgraph_ws}()}, +\code{\link{ring_lattice}()} } \author{ George G. Vega Yon diff --git a/man/rgraph_ws.Rd b/man/rgraph_ws.Rd index 7342f751..971ae020 100644 --- a/man/rgraph_ws.Rd +++ b/man/rgraph_ws.Rd @@ -5,8 +5,15 @@ \alias{small-world} \title{Watts-Strogatz model} \usage{ -rgraph_ws(n, k, p, both.ends = FALSE, self = FALSE, multiple = FALSE, - undirected = FALSE) +rgraph_ws( + n, + k, + p, + both.ends = FALSE, + self = FALSE, + multiple = FALSE, + undirected = FALSE +) } \arguments{ \item{n}{Integer scalar. Set the size of the graph.} @@ -62,10 +69,13 @@ Newman, M. E. J. (2003). The Structure and Function of Complex Networks. SIAM Review, 45(2), 167–256. \url{http://doi.org/10.1137/S003614450342480} } \seealso{ -Other simulation functions: \code{\link{permute_graph}}, - \code{\link{rdiffnet}}, \code{\link{rewire_graph}}, - \code{\link{rgraph_ba}}, \code{\link{rgraph_er}}, - \code{\link{ring_lattice}} +Other simulation functions: +\code{\link{permute_graph}()}, +\code{\link{rdiffnet}()}, +\code{\link{rewire_graph}()}, +\code{\link{rgraph_ba}()}, +\code{\link{rgraph_er}()}, +\code{\link{ring_lattice}()} } \author{ George G. Vega Yon diff --git a/man/ring_lattice.Rd b/man/ring_lattice.Rd index 89843352..20fe48d9 100644 --- a/man/ring_lattice.Rd +++ b/man/ring_lattice.Rd @@ -30,9 +30,12 @@ Watts, D. J., & Strogatz, S. H. (1998). Collective dynamics of “small-world” networks. Nature, 393(6684), 440–2. \url{http://doi.org/10.1038/30918} } \seealso{ -Other simulation functions: \code{\link{permute_graph}}, - \code{\link{rdiffnet}}, \code{\link{rewire_graph}}, - \code{\link{rgraph_ba}}, \code{\link{rgraph_er}}, - \code{\link{rgraph_ws}} +Other simulation functions: +\code{\link{permute_graph}()}, +\code{\link{rdiffnet}()}, +\code{\link{rewire_graph}()}, +\code{\link{rgraph_ba}()}, +\code{\link{rgraph_er}()}, +\code{\link{rgraph_ws}()} } \concept{simulation functions} diff --git a/man/struct_equiv.Rd b/man/struct_equiv.Rd index 8be970e7..47edb7a9 100644 --- a/man/struct_equiv.Rd +++ b/man/struct_equiv.Rd @@ -107,13 +107,18 @@ Valente, T. W. (1995). "Network models of the diffusion of innovations" (2nd ed. Cresskill N.J.: Hampton Press. } \seealso{ -Other statistics: \code{\link{bass}}, - \code{\link{classify_adopters}}, - \code{\link{cumulative_adopt_count}}, \code{\link{dgr}}, - \code{\link{ego_variance}}, \code{\link{exposure}}, - \code{\link{hazard_rate}}, \code{\link{infection}}, - \code{\link{moran}}, \code{\link{threshold}}, - \code{\link{vertex_covariate_dist}} +Other statistics: +\code{\link{bass}}, +\code{\link{classify_adopters}()}, +\code{\link{cumulative_adopt_count}()}, +\code{\link{dgr}()}, +\code{\link{ego_variance}()}, +\code{\link{exposure}()}, +\code{\link{hazard_rate}()}, +\code{\link{infection}()}, +\code{\link{moran}()}, +\code{\link{threshold}()}, +\code{\link{vertex_covariate_dist}()} } \author{ George G. Vega Yon & Thomas W. Valente diff --git a/man/struct_test.Rd b/man/struct_test.Rd index 69df74ed..e7707661 100644 --- a/man/struct_test.Rd +++ b/man/struct_test.Rd @@ -17,12 +17,17 @@ struct_test(graph, statistic, R, rewire.args = list(), ...) \method{print}{diffnet_struct_test}(x, ...) -\method{hist}{diffnet_struct_test}(x, +\method{hist}{diffnet_struct_test}( + x, main = "Empirical Distribution of Statistic", - xlab = expression(Values ~ of ~ t), breaks = 20, annotated = TRUE, + xlab = expression(Values ~ of ~ t), + breaks = 20, + annotated = TRUE, b0 = expression(atop(plain("") \%up\% plain("")), t[0]), - b = expression(atop(plain("") \%up\% plain("")), t[]), ask = TRUE, - ...) + b = expression(atop(plain("") \%up\% plain("")), t[]), + ask = TRUE, + ... +) struct_test_asymp(graph, Y, statistic_name = "distance", p = 2, ...) } @@ -172,8 +177,9 @@ Davidson, R., & MacKinnon, J. G. (2004). Econometric Theory and Methods. New Yor Oxford University Press. } \seealso{ -Other Functions for inference: \code{\link{bootnet}}, - \code{\link{moran}} +Other Functions for inference: +\code{\link{bootnet}()}, +\code{\link{moran}()} } \author{ George G. Vega Yon diff --git a/man/summary.diffnet.Rd b/man/summary.diffnet.Rd index 309c7866..d24faff8 100644 --- a/man/summary.diffnet.Rd +++ b/man/summary.diffnet.Rd @@ -4,8 +4,14 @@ \alias{summary.diffnet} \title{Summary of diffnet objects} \usage{ -\method{summary}{diffnet}(object, slices = NULL, no.print = FALSE, - skip.moran = FALSE, valued = getOption("diffnet.valued", FALSE), ...) +\method{summary}{diffnet}( + object, + slices = NULL, + no.print = FALSE, + skip.moran = FALSE, + valued = getOption("diffnet.valued", FALSE), + ... +) } \arguments{ \item{object}{An object of class \code{\link[=as_diffnet]{diffnet}}.} @@ -64,11 +70,14 @@ summary(medInnovationsDiffNet) } \seealso{ -Other diffnet methods: \code{\link{\%*\%}}, - \code{\link{as.array.diffnet}}, \code{\link{c.diffnet}}, - \code{\link{diffnet-arithmetic}}, - \code{\link{diffnet-class}}, \code{\link{diffnet_index}}, - \code{\link{plot.diffnet}} +Other diffnet methods: +\code{\link{\%*\%}()}, +\code{\link{as.array.diffnet}()}, +\code{\link{c.diffnet}()}, +\code{\link{diffnet-arithmetic}}, +\code{\link{diffnet-class}}, +\code{\link{diffnet_index}}, +\code{\link{plot.diffnet}()} } \author{ George G. Vega Yon diff --git a/man/survey_to_diffnet.Rd b/man/survey_to_diffnet.Rd index 8c107645..0cc83fb5 100644 --- a/man/survey_to_diffnet.Rd +++ b/man/survey_to_diffnet.Rd @@ -5,19 +5,41 @@ \alias{edgelist_to_diffnet} \title{Convert survey-like data and edgelists to a \code{diffnet} object} \usage{ -survey_to_diffnet(dat, idvar, netvars, toavar, groupvar = NULL, - no.unsurveyed = TRUE, timevar = NULL, t = NULL, +survey_to_diffnet( + dat, + idvar, + netvars, + toavar, + groupvar = NULL, + no.unsurveyed = TRUE, + timevar = NULL, + t = NULL, undirected = getOption("diffnet.undirected", FALSE), self = getOption("diffnet.self", FALSE), multiple = getOption("diffnet.multiple", FALSE), - keep.isolates = TRUE, recode.ids = TRUE, warn.coercion = TRUE, ...) - -edgelist_to_diffnet(edgelist, w = NULL, t0 = NULL, t1 = NULL, dat, - idvar, toavar, timevar = NULL, + keep.isolates = TRUE, + recode.ids = TRUE, + warn.coercion = TRUE, + ... +) + +edgelist_to_diffnet( + edgelist, + w = NULL, + t0 = NULL, + t1 = NULL, + dat, + idvar, + toavar, + timevar = NULL, undirected = getOption("diffnet.undirected", FALSE), self = getOption("diffnet.self", FALSE), - multiple = getOption("diffnet.multiple", FALSE), fill.missing = NULL, - keep.isolates = TRUE, recode.ids = TRUE, warn.coercion = TRUE) + multiple = getOption("diffnet.multiple", FALSE), + fill.missing = NULL, + keep.isolates = TRUE, + recode.ids = TRUE, + warn.coercion = TRUE +) } \arguments{ \item{dat}{A data frame.} @@ -172,9 +194,11 @@ all( \seealso{ \code{\link{fakesurvey}}, \code{\link{fakesurveyDyn}} -Other data management functions: \code{\link{diffnet-class}}, - \code{\link{edgelist_to_adjmat}}, - \code{\link{egonet_attrs}}, \code{\link{isolated}} +Other data management functions: +\code{\link{diffnet-class}}, +\code{\link{edgelist_to_adjmat}()}, +\code{\link{egonet_attrs}()}, +\code{\link{isolated}()} } \author{ Vega Yon diff --git a/man/threshold.Rd b/man/threshold.Rd index 033e4f00..8926c026 100644 --- a/man/threshold.Rd +++ b/man/threshold.Rd @@ -4,8 +4,14 @@ \alias{threshold} \title{Retrive threshold levels from the exposure matrix} \usage{ -threshold(obj, toa, t0 = min(toa, na.rm = TRUE), - include_censored = FALSE, lags = 0L, ...) +threshold( + obj, + toa, + t0 = min(toa, na.rm = TRUE), + include_censored = FALSE, + lags = 0L, + ... +) } \arguments{ \item{obj}{Either a \eqn{n\times T}{n * T} matrix (eposure to the innovation obtained from @@ -57,13 +63,18 @@ threshold(diffnet, alt.graph=se) \seealso{ Threshold can be visualized using \code{\link{plot_threshold}} -Other statistics: \code{\link{bass}}, - \code{\link{classify_adopters}}, - \code{\link{cumulative_adopt_count}}, \code{\link{dgr}}, - \code{\link{ego_variance}}, \code{\link{exposure}}, - \code{\link{hazard_rate}}, \code{\link{infection}}, - \code{\link{moran}}, \code{\link{struct_equiv}}, - \code{\link{vertex_covariate_dist}} +Other statistics: +\code{\link{bass}}, +\code{\link{classify_adopters}()}, +\code{\link{cumulative_adopt_count}()}, +\code{\link{dgr}()}, +\code{\link{ego_variance}()}, +\code{\link{exposure}()}, +\code{\link{hazard_rate}()}, +\code{\link{infection}()}, +\code{\link{moran}()}, +\code{\link{struct_equiv}()}, +\code{\link{vertex_covariate_dist}()} } \author{ George G. Vega Yon & Thomas W. Valente diff --git a/man/transformGraphBy.Rd b/man/transformGraphBy.Rd index acddadb3..ad26c8b7 100644 --- a/man/transformGraphBy.Rd +++ b/man/transformGraphBy.Rd @@ -8,11 +8,9 @@ \usage{ transformGraphBy(graph, INDICES, fun = function(g, ...) g, ...) -\method{transformGraphBy}{diffnet}(graph, INDICES, fun = function(g, ...) - g, ...) +\method{transformGraphBy}{diffnet}(graph, INDICES, fun = function(g, ...) g, ...) -\method{transformGraphBy}{dgCMatrix}(graph, INDICES, fun = function(g, - ...) g, ...) +\method{transformGraphBy}{dgCMatrix}(graph, INDICES, fun = function(g, ...) g, ...) } \arguments{ \item{graph}{A graph} diff --git a/man/vertex_covariate_compare.Rd b/man/vertex_covariate_compare.Rd index c7830aaa..0ed76a0e 100644 --- a/man/vertex_covariate_compare.Rd +++ b/man/vertex_covariate_compare.Rd @@ -46,7 +46,8 @@ vertex_covariate_compare(G, x, ">=") vertex_covariate_compare(G, x, "<=") } \seealso{ -Other dyadic-level comparison functions: \code{\link{matrix_compare}}, - \code{\link{vertex_covariate_dist}} +Other dyadic-level comparison functions: +\code{\link{matrix_compare}()}, +\code{\link{vertex_covariate_dist}()} } \concept{dyadic-level comparison functions} diff --git a/man/vertex_covariate_dist.Rd b/man/vertex_covariate_dist.Rd index b3e3e90f..f98288ed 100644 --- a/man/vertex_covariate_dist.Rd +++ b/man/vertex_covariate_dist.Rd @@ -84,16 +84,22 @@ Retrieved 20:31, September 27, 2016, from \seealso{ \code{\link[stats:mahalanobis]{mahalanobis}} in the stats package. -Other statistics: \code{\link{bass}}, - \code{\link{classify_adopters}}, - \code{\link{cumulative_adopt_count}}, \code{\link{dgr}}, - \code{\link{ego_variance}}, \code{\link{exposure}}, - \code{\link{hazard_rate}}, \code{\link{infection}}, - \code{\link{moran}}, \code{\link{struct_equiv}}, - \code{\link{threshold}} - -Other dyadic-level comparison functions: \code{\link{matrix_compare}}, - \code{\link{vertex_covariate_compare}} +Other statistics: +\code{\link{bass}}, +\code{\link{classify_adopters}()}, +\code{\link{cumulative_adopt_count}()}, +\code{\link{dgr}()}, +\code{\link{ego_variance}()}, +\code{\link{exposure}()}, +\code{\link{hazard_rate}()}, +\code{\link{infection}()}, +\code{\link{moran}()}, +\code{\link{struct_equiv}()}, +\code{\link{threshold}()} + +Other dyadic-level comparison functions: +\code{\link{matrix_compare}()}, +\code{\link{vertex_covariate_compare}()} } \author{ George G. Vega Yon