diff --git a/DESCRIPTION b/DESCRIPTION index 5c76d87..b87eec5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -94,3 +94,4 @@ Collate: 'struct_equiv.R' 'struct_test.R' 'survey_to_diffnet.R' + 'zzz.R' diff --git a/R/zzz.R b/R/zzz.R new file mode 100644 index 0000000..73d8406 --- /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 8e4beb2..83ce27d 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 efcb6be..a51e16b 100644 --- a/README.qmd +++ b/README.qmd @@ -105,6 +105,15 @@ library(netdiffuseR) ### Infectiousness and Susceptibility + +> [!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. + + ```{r plot_infectsuscept} # Generating a random graph set.seed(1234) diff --git a/inst/CITATION b/inst/CITATION index f22ff42..2822e4d 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 d862af6..8e2aad0 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 af75698..07dc8df 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 68571c3..649488d 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 cda9dc1..b74e9a3 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 6c460fd..5ee9179 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 401348f..ee3da70 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 $$