From 4cda66a4381c2df3ee2d738f6c97ac0b2916a5c4 Mon Sep 17 00:00:00 2001 From: George G Vega Yon Date: Fri, 21 May 2021 22:09:42 -0700 Subject: [PATCH] Solving issues with URLs and adding paper citation --- DESCRIPTION | 3 +- Makefile | 25 ++++++---- R/random_graph.R | 2 +- README.Rmd | 22 +++++---- README.md | 121 +++++++++++++++++++++++++++++------------------ inst/CITATION | 27 ++++++++++- man/rgraph_ba.Rd | 2 +- 7 files changed, 133 insertions(+), 69 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index b4e0e780..0cd7d971 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: netdiffuseR Title: Analysis of Diffusion and Contagion Processes on Networks -Version: 1.22.1 +Version: 1.22.2 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") @@ -22,6 +22,7 @@ Depends: R (>= 3.1.1) License: MIT + file LICENSE LazyData: true +Date: 2021-05-21 Imports: Rcpp (>= 0.12.1), sna, diff --git a/Makefile b/Makefile index 5aa67730..e98edc86 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,10 @@ -netdiffuseR.tar.gz: */*.R - $(MAKE) clean ; \ - R CMD build . && \ - mv netdiffuseR*.tar.gz netdiffuseR.tar.gz +VERSION:=$(shell Rscript -e 'x<-readLines("DESCRIPTION");cat(gsub(".+[:]\\s*", "", x[grepl("^Vers", x)]))') + +install: netdiffuseR_$(VERSION).tar.gz + R CMD INSTALL netdiffuseR_$(VERSION).tar.gz + +netdiffuseR_$(VERSION).tar.gz: */*.R inst/NEWS README.md + R CMD build . inst/NEWS: NEWS.md Rscript -e "rmarkdown::pandoc_convert('NEWS.md', 'plain', output='inst/NEWS')"&& \ @@ -12,11 +15,15 @@ README.md: README.Rmd .PHONY: check checkv clean -check: netdiffuseR.tar.gz - R CMD check --as-cran netdiffuseR.tar.gz +check: netdiffuseR_$(VERSION).tar.gz + R CMD check --as-cran netdiffuseR_$(VERSION).tar.gz -checkv: netdiffuseR.tar.gz - R CMD check --as-cran --use-valgrind netdiffuseR.tar.gz +checkv: netdiffuseR_$(VERSION).tar.gz + R CMD check --as-cran --use-valgrind netdiffuseR_$(VERSION).tar.gz clean: - rm -rf netdiffuseR.Rcheck ; rm -f netdiffuseR.tar.gz + rm -rf netdiffuseR.Rcheck + +man/moran.Rd: R/* src/*.cpp src/*.h + Rscript --vanilla -e 'roxygen2::roxygenize()' + diff --git a/R/random_graph.R b/R/random_graph.R index 3dc129df..540184dd 100644 --- a/R/random_graph.R +++ b/R/random_graph.R @@ -164,7 +164,7 @@ rgraph_er <- function(n=10, t=1, p=0.01, undirected=getOption("diffnet.undirecte #' Networks. Science, 286(5439), 509–512. \doi{10.1126/science.286.5439.509} #' #' Albert-László Barabási. (2016). Network Science: (1st ed.). Cambridge University Press. -#' Retrieved from \url{http://barabasi.com/book/network-science} +#' Retrieved from \url{https://barabasi.com/book/network-science} #' #' De Almeida, M. L., Mendes, G. A., Madras Viswanathan, G., & Da Silva, L. R. (2013). #' Scale-free homophilic network. European Physical Journal B, 86(2). diff --git a/README.Rmd b/README.Rmd index 6fe3738a..a4a19877 100644 --- a/README.Rmd +++ b/README.Rmd @@ -6,10 +6,10 @@ output: [![R-CMD-check](https://github.com/USCCANA/netdiffuseR/actions/workflows/r.yml/badge.svg)](https://github.com/USCCANA/netdiffuseR/actions/workflows/r.yml) [![Build status](https://ci.appveyor.com/api/projects/status/6u48wgl1lqak2jum?svg=true)](https://ci.appveyor.com/project/gvegayon/netdiffuser) -[![codecov.io](https://codecov.io/github/USCCANA/netdiffuseR/coverage.svg?branch=master)](https://codecov.io/github/USCCANA/netdiffuseR?branch=master) -[![](http://cranlogs.r-pkg.org/badges/netdiffuseR)](http://cran.r-project.org/package=netdiffuseR) -[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/netdiffuseR)](http://cran.r-project.org/package=netdiffuseR) -[![](http://cranlogs.r-pkg.org/badges/grand-total/netdiffuseR)](http://cran.rstudio.com/web/packages/netdiffuseR/index.html) +[![codecov.io](https://codecov.io/github/USCCANA/netdiffuseR/coverage.svg?branch=master)](https://codecov.io/github/USCCANA/netdiffuseR?branch=master) +[![](https://cranlogs.r-pkg.org/badges/netdiffuseR)](https://cran.r-project.org/package=netdiffuseR) +[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/netdiffuseR)](https://cran.r-project.org/package=netdiffuseR) +[![](https://cranlogs.r-pkg.org/badges/grand-total/netdiffuseR)](https://cran.r-project.org/package=netdiffuseR) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1039317.svg)](https://doi.org/10.5281/zenodo.1039317) [![Dependencies](https://tinyverse.netlify.com/badge/netdiffuseR)](https://cran.r-project.org/package=netdiffuseR) [![USC's Department of Preventive Medicine](https://raw.githubusercontent.com/USCbiostats/badges/master/tommy-uscprevmed-badge.svg)](https://preventivemedicine.usc.edu) @@ -21,7 +21,7 @@ This package contains functions useful for analyzing network data for diffusion The package was developed as part of the paper Thomas W. Valente, Stephanie R. Dyal, Kar-Hai Chu, Heather Wipfli, Kayo Fujimoto, *Diffusion of innovations theory applied to global tobacco control treaty ratification*, Social Science & Medicine, Volume 145, November 2015, Pages 89-97, ISSN 0277-9536 -(available [here](http://www.sciencedirect.com/science/article/pii/S027795361530143X)) +(available [here](https://www.sciencedirect.com/science/article/pii/S027795361530143X)) From the description: @@ -36,15 +36,19 @@ From the description: __Acknowledgements__: netdiffuseR was created with the support of grant R01 CA157577 from the National Cancer Institute/National Institutes of Health. +```{r, comment = ""} +citation(package="netdiffuseR") +``` + ## News Changelog can be view [here](NEWS.md). * [2016-06-02] A video of the __netdiffuseR__ workshop at SUNBELT 2016 is now online on [youtube](https://www.youtube.com/playlist?list=PLT-GgRN1lFI4coHDqkRJm3flDw9e1gg2P), and the workshop materials can be found [here](https://github.com/USCCANA/netdiffuser-sunbelt2016/) -* [2016-04-11] __netdiffuseR__ will be on [useR! 2016](https://user2016.r-project.org/) on as a presentation and on [IC2S2 2016](http://www.kellogg.northwestern.edu/news-events/conference/ic2s2/2016.aspx) in the posters session. +* [2016-04-11] __netdiffuseR__ will be on [useR! 2016](https://user2016.r-project.org/) on as a presentation and on [IC2S2 2016](https://www.kellogg.northwestern.edu/news-events/conference/ic2s2/2016.aspx) in the posters session. * [2016-03-16] Next CRAN release scheduled for April 11th 2016 (after the workshop). * [2016-02-18] __netdiffuseR__ vers 1.16.2 is now on CRAN! -* [2016-02-18] We will be offering a workshop at the 2016 SUNBELT Conference (checkout the full list of workshops [here](http://insna.org/sunbelt2016/program/)). +* [2016-02-18] We will be offering a workshop at the 2016 SUNBELT Conference (checkout the full list of workshops [here](http://sunbelt2016.insna.org/program/)). ## Installation @@ -103,8 +107,8 @@ For the case of windows and mac users, they can find binary versions of the pack Since starting netdiffuseR, we have done a couple of workshops at Sunbelt and NASN. Here are the repositories: -* Sunbelt 2018: https://USCCANA.github.io/netdiffuser-sunbelt2018 ([source code](https://github.com/USCCANA/netdiffuser-sunbelt2018)) -* NASN 2017: https://USCCANA.github.io/netdiffuser-nasn2017 ([source code](https://github.com/USCCANA/netdiffuser-nasn2017)) +* Sunbelt 2018: https://usccana.github.io/netdiffuser-sunbelt2018/ ([source code](https://github.com/USCCANA/netdiffuser-sunbelt2018)) +* NASN 2017: https://usccana.github.io/netdiffuser-nasn2017/ ([source code](https://github.com/USCCANA/netdiffuser-nasn2017)) * Sunbelt 2016: https://github.com/USCCANA/netdiffuser-sunbelt2016 ## Presentations diff --git a/README.md b/README.md index 568940d0..7c6bd80c 100644 --- a/README.md +++ b/README.md @@ -3,17 +3,19 @@ [![Build status](https://ci.appveyor.com/api/projects/status/6u48wgl1lqak2jum?svg=true)](https://ci.appveyor.com/project/gvegayon/netdiffuser) [![codecov.io](https://codecov.io/github/USCCANA/netdiffuseR/coverage.svg?branch=master)](https://codecov.io/github/USCCANA/netdiffuseR?branch=master) -[![](http://cranlogs.r-pkg.org/badges/netdiffuseR)](http://cran.r-project.org/package=netdiffuseR) -[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/netdiffuseR)](http://cran.r-project.org/package=netdiffuseR) -[![](http://cranlogs.r-pkg.org/badges/grand-total/netdiffuseR)](http://cran.rstudio.com/web/packages/netdiffuseR/index.html) +[![](https://cranlogs.r-pkg.org/badges/netdiffuseR)](https://cran.r-project.org/package=netdiffuseR) +[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/netdiffuseR)](https://cran.r-project.org/package=netdiffuseR) +[![](https://cranlogs.r-pkg.org/badges/grand-total/netdiffuseR)](https://cran.r-project.org/package=netdiffuseR) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1039317.svg)](https://doi.org/10.5281/zenodo.1039317) [![Dependencies](https://tinyverse.netlify.com/badge/netdiffuseR)](https://cran.r-project.org/package=netdiffuseR) [![USC’s Department of Preventive Medicine](https://raw.githubusercontent.com/USCbiostats/badges/master/tommy-uscprevmed-badge.svg)](https://preventivemedicine.usc.edu)

+ netdiffuseR: Analysis of Diffusion and Contagion Processes on Networks +

This package contains functions useful for analyzing network data for @@ -24,7 +26,7 @@ Stephanie R. Dyal, Kar-Hai Chu, Heather Wipfli, Kayo Fujimoto, *Diffusion of innovations theory applied to global tobacco control treaty ratification*, Social Science & Medicine, Volume 145, November 2015, Pages 89-97, ISSN 0277-9536 (available -[here](http://www.sciencedirect.com/science/article/pii/S027795361530143X)) +[here](https://www.sciencedirect.com/science/article/pii/S027795361530143X)) From the description: @@ -40,26 +42,48 @@ From the description: R01 CA157577 from the National Cancer Institute/National Institutes of Health. +``` r +citation(package="netdiffuseR") +``` + +``` + +To cite netdiffuseR in publications use: + + Valente TW, Vega Yon GG. Diffusion/Contagion Processes on Social + Networks. Health Education & Behavior. 2020;47(2):235-248. + doi:10.1177/1090198120901497 + +Vega Yon G, Valente T (2021). _netdiffuseR: Analysis of Diffusion and +Contagion Processes on Networks_. doi: 10.5281/zenodo.1039317 (URL: +https://doi.org/10.5281/zenodo.1039317), R package version 1.22.2, +. + +To see these entries in BibTeX format, use 'print(, +bibtex=TRUE)', 'toBibtex(.)', or set +'options(citation.bibtex.max=999)'. +``` + ## News Changelog can be view [here](NEWS.md). -- \[2016-06-02\] A video of the **netdiffuseR** workshop at SUNBELT + - \[2016-06-02\] A video of the **netdiffuseR** workshop at SUNBELT 2016 is now online on [youtube](https://www.youtube.com/playlist?list=PLT-GgRN1lFI4coHDqkRJm3flDw9e1gg2P), and the workshop materials can be found [here](https://github.com/USCCANA/netdiffuser-sunbelt2016/) -- \[2016-04-11\] **netdiffuseR** will be on [useR! - 2016](https://user2016.r-project.org/) on as a presentation and on - [IC2S2 - 2016](http://www.kellogg.northwestern.edu/news-events/conference/ic2s2/2016.aspx) + - \[2016-04-11\] **netdiffuseR** will be on + [useR\! 2016](https://user2016.r-project.org/) on as a presentation + and on + [IC2S2 2016](https://www.kellogg.northwestern.edu/news-events/conference/ic2s2/2016.aspx) in the posters session. -- \[2016-03-16\] Next CRAN release scheduled for April 11th 2016 + - \[2016-03-16\] Next CRAN release scheduled for April 11th 2016 (after the workshop). -- \[2016-02-18\] **netdiffuseR** vers 1.16.2 is now on CRAN! -- \[2016-02-18\] We will be offering a workshop at the 2016 SUNBELT + - \[2016-02-18\] **netdiffuseR** vers 1.16.2 is now on CRAN\! + - \[2016-02-18\] We will be offering a workshop at the 2016 SUNBELT Conference (checkout the full list of workshops - [here](http://insna.org/sunbelt2016/program/)). + [here](http://sunbelt2016.insna.org/program/)). ## Installation @@ -103,16 +127,19 @@ netdiffuseR\_1…zip, and netdiffuseR\_1…tgz respectively. They can install this directly as follows (using the 1.16.3.29 version): 1. Install dependencies from CRAN - `r > install.packages(c("igraph", "Matrix", "SparseM", "RcppArmadillo", "sna"), dependencies=TRUE)` + + ``` r + > install.packages(c("igraph", "Matrix", "SparseM", "RcppArmadillo", "sna"), dependencies=TRUE) + ``` 2. Download the binary version and install it as follows: - + ``` r > install.packages("netdiffuseR_1.16.3.29.zip", repos=NULL) ``` - + For windows users, and for Mac users: - + ``` r > install.packages("netdiffuseR_1.16.3.29.tgz", repos=NULL) ``` @@ -122,19 +149,19 @@ install this directly as follows (using the 1.16.3.29 version): Since starting netdiffuseR, we have done a couple of workshops at Sunbelt and NASN. Here are the repositories: -- Sunbelt 2018: + - Sunbelt 2018: ([source code](https://github.com/USCCANA/netdiffuser-sunbelt2018)) -- NASN 2017: ([source - code](https://github.com/USCCANA/netdiffuser-nasn2017)) -- Sunbelt 2016: + - NASN 2017: + ([source code](https://github.com/USCCANA/netdiffuser-nasn2017)) + - Sunbelt 2016: ## Presentations -- ic2s2 2016 Evanston, IL: + - ic2s2 2016 Evanston, IL: (poster) -- useR! 2016 Stanford, CA: + - useR\! 2016 Stanford, CA: (slides) -- useR! 2016: + - useR\! 2016: ## Examples @@ -388,7 +415,7 @@ par(oldpar) sessionInfo() ``` - ## R version 4.0.5 (2021-03-31) + ## R version 4.1.0 (2021-05-18) ## Platform: x86_64-pc-linux-gnu (64-bit) ## Running under: Ubuntu 18.04.5 LTS ## @@ -408,49 +435,49 @@ sessionInfo() ## [1] stats graphics grDevices utils datasets methods base ## ## other attached packages: - ## [1] netdiffuseR_1.22.0 + ## [1] netdiffuseR_1.22.2 ## ## loaded via a namespace (and not attached): ## [1] igraph_1.2.6 Rcpp_1.0.6 knitr_1.33 ## [4] magrittr_2.0.1 networkDynamic_0.10.1 network_1.16.1 ## [7] MASS_7.3-54 viridisLite_0.4.0 lattice_0.20-44 ## [10] rlang_0.4.11 fansi_0.4.2 highr_0.9 - ## [13] stringr_1.4.0 tools_4.0.5 MatchIt_4.1.0 - ## [16] grid_4.0.5 rle_0.9.2 xfun_0.22 + ## [13] stringr_1.4.0 tools_4.1.0 MatchIt_4.1.0 + ## [16] grid_4.1.0 rle_0.9.2 xfun_0.23 ## [19] utf8_1.2.1 sna_2.6 coda_0.19-4 ## [22] htmltools_0.5.1.1 ellipsis_0.3.2 yaml_2.2.1 - ## [25] digest_0.6.27 tibble_3.1.1 lifecycle_1.0.0 + ## [25] digest_0.6.27 tibble_3.1.2 lifecycle_1.0.0 ## [28] crayon_1.4.1 Matrix_1.3-3 vctrs_0.3.8 - ## [31] evaluate_0.14 statnet.common_4.4.1 rmarkdown_2.7 - ## [34] stringi_1.5.3 compiler_4.0.5 pillar_1.6.0 + ## [31] evaluate_0.14 statnet.common_4.4.1 rmarkdown_2.8 + ## [34] stringi_1.6.2 compiler_4.1.0 pillar_1.6.1 ## [37] backports_1.2.1 boot_1.3-28 SparseM_1.81 ## [40] pkgconfig_2.0.3 ## To-do list -- Import/Export functions for interfacing other package’s clases, in + - Import/Export functions for interfacing other package’s clases, in particular: `statnet` set (specially the packages `networkDynamic` and `ndtv`), ~~`igraph`~~ and `Rsiena`. -- Populate the tests folder. -- ~~Use spells? (`select_egoalter` would use this)~~ -- ~~Classify individuals by adoption category using early adopters, + - Populate the tests folder. + - ~~Use spells? (`select_egoalter` would use this)~~ + - ~~Classify individuals by adoption category using early adopters, adopters, and laggards, and by threshold using very low, low, high and very high threshold (Valente 95’ p. 94).~~ -- ~~Double check all functions using adjacency matrix values.~~ -- ~~Remove dimnames from matrices and vectors. It is more efficient to + - ~~Double check all functions using adjacency matrix values.~~ + - ~~Remove dimnames from matrices and vectors. It is more efficient to use the ones stored in meta instead.~~ -- Implement the Bass model -- ~~Include function to import survey data (as shown on the + - Implement the Bass model + - ~~Include function to import survey data (as shown on the vignettes)~~ -- Exposure based on Mahalanobis distances and also Roger Leenders on + - Exposure based on Mahalanobis distances and also Roger Leenders on weighting exposure (internal note). -- (2016-03-30): use `xspline` for drawing polygons & edges. -- ~~(2016-04-04): Add more options to `exposure`, namely, `self` (so - removes diagonal or not!).~~ -- (2016-04-19): animal behaviorists. -- (2016-10-18): Review language throughout the manual (more than + - (2016-03-30): use `xspline` for drawing polygons & edges. + - ~~(2016-04-04): Add more options to `exposure`, namely, `self` (so + removes diagonal or not\!).~~ + - (2016-04-19): animal behaviorists. + - (2016-10-18): Review language throughout the manual (more than innovation). -- (2016-10-18): Evaluate and eventually use a standard graph format + - (2016-10-18): Evaluate and eventually use a standard graph format (`network` for instance?). -- (2016-10-18): Standarize graph plot methods (choose either + - (2016-10-18): Standarize graph plot methods (choose either statnet/igraph/own) diff --git a/inst/CITATION b/inst/CITATION index 2f40e626..b05d82b9 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -1,6 +1,29 @@ year <- sub("-.*", "", meta$Date) note <- sprintf("R package version %s", meta$Version) +citHeader("To cite netdiffuseR in publications use the following paper:") + +citEntry( + entry = "Article", + title = "Diffusion/Contagion Processes on Social Networks", + author = c( + person("Thomas", "Valente"), + person("George", "Vega Yon") + ), + journal = "Health Education & Behavior", + year = "2020", + month = "feb", + volume = 42, + issue = 2, + doi = "10.1177/1090198120901497", + url = "https://doi.org/10.1177/1090198120901497", + issn = "1367-4803", + pages = "235-248", + note = "{PMID: 32090655}", + textVersion = "Valente TW, Vega Yon GG. Diffusion/Contagion Processes on Social Networks. Health Education & Behavior. 2020;47(2):235-248. doi:10.1177/1090198120901497" +) + + bibentry(bibtype = "Manual", title = "{{netdiffuseR: Analysis of Diffusion and Contagion Processes on Networks}}", author = c( @@ -10,4 +33,6 @@ bibentry(bibtype = "Manual", year = year, note = note, url = "https://github.com/USCCANA/netdiffuseR", - doi = "10.5281/zenodo.1039317") + doi = "10.5281/zenodo.1039317", + header = "And the actual R package:") + diff --git a/man/rgraph_ba.Rd b/man/rgraph_ba.Rd index 50c3b219..dad8239a 100644 --- a/man/rgraph_ba.Rd +++ b/man/rgraph_ba.Rd @@ -96,7 +96,7 @@ Albert-László Barabási, & Albert, R. (1999). Emergence of Scaling in Random Networks. Science, 286(5439), 509–512. \doi{10.1126/science.286.5439.509} Albert-László Barabási. (2016). Network Science: (1st ed.). Cambridge University Press. -Retrieved from \url{http://barabasi.com/book/network-science} +Retrieved from \url{https://barabasi.com/book/network-science} De Almeida, M. L., Mendes, G. A., Madras Viswanathan, G., & Da Silva, L. R. (2013). Scale-free homophilic network. European Physical Journal B, 86(2).