Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,4 @@ Collate:
'struct_equiv.R'
'struct_test.R'
'survey_to_diffnet.R'
'zzz.R'
5 changes: 5 additions & 0 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.onAttach <- function(libname, pkgname) {
packageStartupMessage(
"Using netdiffuseR in your research? Please cite it: citation(\"netdiffuseR\")"
)
}
Comment on lines +1 to +5
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ library(netdiffuseR)

``` r
# Generating a random graph

<!-- how-to-cite -->
> [!NOTE]
> **How to cite netdiffuseR.** If you use **netdiffuseR** in published work, please cite it:
Comment on lines 131 to +136
>
> 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.
<!-- how-to-cite -->

set.seed(1234)
n <- 100
nper <- 20
Expand Down
9 changes: 9 additions & 0 deletions README.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ library(netdiffuseR)

### Infectiousness and Susceptibility

<!-- how-to-cite -->
> [!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.
<!-- how-to-cite -->

```{r plot_infectsuscept}
# Generating a random graph
set.seed(1234)
Expand Down
70 changes: 41 additions & 29 deletions inst/CITATION
Original file line number Diff line number Diff line change
@@ -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:"
)
5 changes: 5 additions & 0 deletions vignettes/analyzing-medical-innovation-data.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ vignette: >
%\usepackage[utf8]{inputenc}
---

<!-- how-to-cite -->
> **How to cite.** If you use **netdiffuseR** in published work, please cite it — run
> `citation("netdiffuseR")` in R for the full entry.
<!-- how-to-cite -->

```{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)
Expand Down
5 changes: 5 additions & 0 deletions vignettes/introduction-to-netdiffuser.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ vignette: >
%\usepackage[utf8]{inputenc}
---

<!-- how-to-cite -->
> **How to cite.** If you use **netdiffuseR** in published work, please cite it — run
> `citation("netdiffuseR")` in R for the full entry.
<!-- how-to-cite -->

```{r Setup, echo=FALSE}
library(knitr)
knitr::opts_chunk$set(fig.width=9, fig.height=6, out.width="600px",fig.align = "center")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ vignette: >
output: html_vignette
---

<!-- how-to-cite -->
> **How to cite.** If you use **netdiffuseR** in published work, please cite it — run
> `citation("netdiffuseR")` in R for the full entry.
<!-- how-to-cite -->

\tableofcontents

# Introduction
Expand Down
5 changes: 5 additions & 0 deletions vignettes/rdiffnets.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ vignette: >
%\usepackage[utf8]{inputenc}
---

<!-- how-to-cite -->
> **How to cite.** If you use **netdiffuseR** in published work, please cite it — run
> `citation("netdiffuseR")` in R for the full entry.
<!-- how-to-cite -->

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
Expand Down
5 changes: 5 additions & 0 deletions vignettes/simulating-multiple-behaviors-on-networks.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ vignette: >
%\VignetteEncoding{UTF-8}
---

<!-- how-to-cite -->
> **How to cite.** If you use **netdiffuseR** in published work, please cite it — run
> `citation("netdiffuseR")` in R for the full entry.
<!-- how-to-cite -->

\tableofcontents

News for **netdiffuseR** package.
Expand Down
5 changes: 5 additions & 0 deletions vignettes/time_discount_suscep_infect.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ vignette: >
\usepackage[utf8]{inputenc}
---

<!-- how-to-cite -->
> **How to cite.** If you use **netdiffuseR** in published work, please cite it — run
> `citation("netdiffuseR")` in R for the full entry.
<!-- how-to-cite -->

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

$$
Expand Down