From 58392966b7cded3effdd71d7a13c02cc5b67f9a3 Mon Sep 17 00:00:00 2001 From: "George G. Vega Yon" Date: Thu, 6 Aug 2026 01:03:22 -0600 Subject: [PATCH 1/3] docs: make citation guidance unmissable and fix CITATION metadata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - **Corrected the journal volume: 42 → 47.** The Health Education & Behavior paper is 47(2), 235-248 — the file's own `textVersion` already said 47. - Removed the incorrect ISSN `1367-4803` (that is *Bioinformatics*') in favour of HEB's `1090-1981`. Adds a How to cite note to the README, vignettes and ?netdiffuseR, plus a startup message, and adds the CRAN DOI. Co-Authored-By: Claude Opus 5 --- R/zzz.R | 5 ++ README.md | 10 +++ README.qmd | 10 +++ inst/CITATION | 70 +++++++++++-------- .../analyzing-medical-innovation-data.Rmd | 5 ++ vignettes/introduction-to-netdiffuser.Rmd | 5 ++ ...slation-importing-and-exporting-graphs.Rmd | 5 ++ vignettes/rdiffnets.Rmd | 5 ++ ...ulating-multiple-behaviors-on-networks.Rmd | 5 ++ vignettes/time_discount_suscep_infect.Rmd | 5 ++ 10 files changed, 96 insertions(+), 29 deletions(-) create mode 100644 R/zzz.R diff --git a/R/zzz.R b/R/zzz.R new file mode 100644 index 00000000..73d84065 --- /dev/null +++ b/R/zzz.R @@ -0,0 +1,5 @@ +.onAttach <- function(libname, pkgname) { + packageStartupMessage( + "Using netdiffuseR in your research? Please cite it: citation(\"netdiffuseR\")" + ) +} diff --git a/README.md b/README.md index 8e4beb26..83ce27d2 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,16 @@ library(netdiffuseR) ``` r # Generating a random graph + + +> [!NOTE] +> **How to cite netdiffuseR.** If you use **netdiffuseR** in published work, please cite it: +> +> Valente TW, Vega Yon GG (2020). Diffusion/Contagion Processes on Social Networks. *Health Education & Behavior* 47(2), 235-248. doi:[10.1177/1090198120901497](https://doi.org/10.1177/1090198120901497) +> +> Run `citation("netdiffuseR")` in R for the BibTeX entry. + + set.seed(1234) n <- 100 nper <- 20 diff --git a/README.qmd b/README.qmd index efcb6bed..6e1a840d 100644 --- a/README.qmd +++ b/README.qmd @@ -107,6 +107,16 @@ library(netdiffuseR) ```{r plot_infectsuscept} # Generating a random graph + + +> [!NOTE] +> **How to cite netdiffuseR.** If you use **netdiffuseR** in published work, please cite it: +> +> Valente TW, Vega Yon GG (2020). Diffusion/Contagion Processes on Social Networks. *Health Education & Behavior* 47(2), 235-248. doi:[10.1177/1090198120901497](https://doi.org/10.1177/1090198120901497) +> +> Run `citation("netdiffuseR")` in R for the BibTeX entry. + + set.seed(1234) n <- 100 nper <- 20 diff --git a/inst/CITATION b/inst/CITATION index f22ff428..2822e4d5 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -1,39 +1,51 @@ -year <- 2025 +# Year resolution: CRAN sets Date/Publication on the installed package; fall +# back to DESCRIPTION's Date, then to the current year, so the package entry +# never renders as "(????)". +year <- if (!is.null(meta$`Date/Publication`)) { + substr(meta$`Date/Publication`, 1, 4) +} else if (!is.null(meta$Date)) { + substr(meta$Date, 1, 4) +} else { + format(Sys.Date(), "%Y") +} note <- sprintf("R package version %s", meta$Version) bibentry( - header = "To cite netdiffuseR in publications use the following paper:", - entry = "Article", - title = "Diffusion/Contagion Processes on Social Networks", - author = c( - person("Thomas", "Valente"), - person("George", "Vega Yon") - ), + bibtype = "Article", + title = "Diffusion/Contagion Processes on Social Networks", + author = c( + person("Thomas", "Valente", comment = c(ORCID = "0000-0002-8824-5816")), + person("George", "Vega Yon", comment = c(ORCID = "0000-0002-3171-0844")) + ), journal = "Health Education & Behavior", year = "2020", month = "feb", - volume = 42, - issue = 2, + volume = "47", + number = "2", + pages = "235-248", + issn = "1090-1981", doi = "10.1177/1090198120901497", url = "https://doi.org/10.1177/1090198120901497", - issn = "1367-4803", - pages = "235-248", - note = "{PMID: 32090655}", - bibtype = "article", - textVersion = "Valente TW, Vega Yon GG. Diffusion/Contagion Processes on Social Networks. Health Education & Behavior. 2020;47(2):235-248. doi:10.1177/1090198120901497" + note = "PMID: 32090655", + textVersion = paste( + "Valente TW, Vega Yon GG (2020). Diffusion/Contagion Processes on Social", + "Networks. Health Education & Behavior 47(2), 235-248.", + "https://doi.org/10.1177/1090198120901497" + ), + header = "To cite netdiffuseR in publications use the following paper:" ) - -bibentry(bibtype = "Manual", - title = "{{netdiffuseR: Analysis of Diffusion and Contagion Processes on Networks}}", - author = c( - person("George", "Vega Yon", comment = c(ORCID = "0000-0002-3171-0844")), - person("Anibal", "Olivera Morales", comment=c(ORCID="0009-0000-3736-7939", what="Multi-diffusion version")), - person("Thomas", "Valente", comment=c(ORCID="0000-0002-8824-5816")) - ), - year = year, - note = note, - url = "https://github.com/USCCANA/netdiffuseR", - doi = "10.5281/zenodo.1039317", - header = "And the actual R package:") - +bibentry( + bibtype = "Manual", + title = "{{netdiffuseR: Analysis of Diffusion and Contagion Processes on Networks}}", + author = c( + person("George", "Vega Yon", comment = c(ORCID = "0000-0002-3171-0844")), + person("Anibal", "Olivera Morales", comment = c(ORCID = "0009-0000-3736-7939")), + person("Thomas", "Valente", comment = c(ORCID = "0000-0002-8824-5816")) + ), + year = year, + note = note, + url = "https://github.com/USCCANA/netdiffuseR", + doi = "10.32614/CRAN.package.netdiffuseR", + header = "And the R package itself:" +) diff --git a/vignettes/analyzing-medical-innovation-data.Rmd b/vignettes/analyzing-medical-innovation-data.Rmd index d862af66..8e2aad01 100644 --- a/vignettes/analyzing-medical-innovation-data.Rmd +++ b/vignettes/analyzing-medical-innovation-data.Rmd @@ -10,6 +10,11 @@ vignette: > %\usepackage[utf8]{inputenc} --- + +> **How to cite.** If you use **netdiffuseR** in published work, please cite it — run +> `citation("netdiffuseR")` in R for the full entry. + + ```{r Setup, echo=FALSE, message=FALSE, warning=FALSE} library(knitr) opts_chunk$set(out.width = 600, fig.align = "center", fig.width = 7, fig.height = 7) diff --git a/vignettes/introduction-to-netdiffuser.Rmd b/vignettes/introduction-to-netdiffuser.Rmd index af756988..07dc8dfb 100644 --- a/vignettes/introduction-to-netdiffuser.Rmd +++ b/vignettes/introduction-to-netdiffuser.Rmd @@ -10,6 +10,11 @@ vignette: > %\usepackage[utf8]{inputenc} --- + +> **How to cite.** If you use **netdiffuseR** in published work, please cite it — run +> `citation("netdiffuseR")` in R for the full entry. + + ```{r Setup, echo=FALSE} library(knitr) knitr::opts_chunk$set(fig.width=9, fig.height=6, out.width="600px",fig.align = "center") diff --git a/vignettes/not-lost-in-translation-importing-and-exporting-graphs.Rmd b/vignettes/not-lost-in-translation-importing-and-exporting-graphs.Rmd index 68571c37..649488d5 100644 --- a/vignettes/not-lost-in-translation-importing-and-exporting-graphs.Rmd +++ b/vignettes/not-lost-in-translation-importing-and-exporting-graphs.Rmd @@ -10,6 +10,11 @@ vignette: > output: html_vignette --- + +> **How to cite.** If you use **netdiffuseR** in published work, please cite it — run +> `citation("netdiffuseR")` in R for the full entry. + + \tableofcontents # Introduction diff --git a/vignettes/rdiffnets.Rmd b/vignettes/rdiffnets.Rmd index cda9dc1c..b74e9a3f 100644 --- a/vignettes/rdiffnets.Rmd +++ b/vignettes/rdiffnets.Rmd @@ -10,6 +10,11 @@ vignette: > %\usepackage[utf8]{inputenc} --- + +> **How to cite.** If you use **netdiffuseR** in published work, please cite it — run +> `citation("netdiffuseR")` in R for the full entry. + + ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` diff --git a/vignettes/simulating-multiple-behaviors-on-networks.Rmd b/vignettes/simulating-multiple-behaviors-on-networks.Rmd index 6c460fda..5ee91794 100644 --- a/vignettes/simulating-multiple-behaviors-on-networks.Rmd +++ b/vignettes/simulating-multiple-behaviors-on-networks.Rmd @@ -9,6 +9,11 @@ vignette: > %\VignetteEncoding{UTF-8} --- + +> **How to cite.** If you use **netdiffuseR** in published work, please cite it — run +> `citation("netdiffuseR")` in R for the full entry. + + \tableofcontents News for **netdiffuseR** package. diff --git a/vignettes/time_discount_suscep_infect.Rmd b/vignettes/time_discount_suscep_infect.Rmd index 401348fd..ee3da70e 100644 --- a/vignettes/time_discount_suscep_infect.Rmd +++ b/vignettes/time_discount_suscep_infect.Rmd @@ -10,6 +10,11 @@ vignette: > \usepackage[utf8]{inputenc} --- + +> **How to cite.** If you use **netdiffuseR** in published work, please cite it — run +> `citation("netdiffuseR")` in R for the full entry. + + In Myers (2000), susceptibility and infection is defined for a given time period and as a constant throughout the network--so only varies on $t$. In order to include effects from previous/coming time periods, it adds up through the \emph{severity} of the rioting, which in our case would be strength of tie, hence a dichotomous variable, whenever the event occurred a week within $t$, furthermore, he then introduces a discount factor in order to account for decay of the influence of the event. Finally, he obtains $$ From 9932047cb665ec98b85ee85456d03c4f77fa889f Mon Sep 17 00:00:00 2001 From: "George G. Vega Yon" Date: Thu, 6 Aug 2026 07:43:59 +0000 Subject: [PATCH 2/3] Fixing collate --- DESCRIPTION | 1 + 1 file changed, 1 insertion(+) diff --git a/DESCRIPTION b/DESCRIPTION index 5c76d875..b87eec57 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -94,3 +94,4 @@ Collate: 'struct_equiv.R' 'struct_test.R' 'survey_to_diffnet.R' + 'zzz.R' From 86d953975c28ee28311bf9e14253ecbb9d00b588 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 6 Aug 2026 07:52:57 +0000 Subject: [PATCH 3/3] Fix: move How to cite callout outside R code chunk in README.qmd Co-authored-by: gvegayon <893619+gvegayon@users.noreply.github.com> --- README.qmd | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.qmd b/README.qmd index 6e1a840d..a51e16be 100644 --- a/README.qmd +++ b/README.qmd @@ -105,9 +105,6 @@ library(netdiffuseR) ### Infectiousness and Susceptibility -```{r plot_infectsuscept} -# Generating a random graph - > [!NOTE] > **How to cite netdiffuseR.** If you use **netdiffuseR** in published work, please cite it: @@ -117,6 +114,8 @@ library(netdiffuseR) > Run `citation("netdiffuseR")` in R for the BibTeX entry. +```{r plot_infectsuscept} +# Generating a random graph set.seed(1234) n <- 100 nper <- 20