Skip to content

Preparing for CRAN release #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jun 12, 2025
Merged
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
5 changes: 3 additions & 2 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
.*\.doc
.*\.pdf
# Misc
README[.]Rmd
README[.](R|q)md
^README\_files$
[.]travis[.]yml
^appveyor\.yml$
Expand All @@ -39,4 +39,5 @@ makefile
^netdiffuseR\.tar\.gz$
^\.github
netdiffuseR\.Rcheck

^\.devcontainer$
^\.vscode$
4 changes: 4 additions & 0 deletions .devcontainer/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"r.plot.useHttpgd": true,
"r.alwaysUseActiveTerminal": true
}
16 changes: 16 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM rocker/tidyverse:4.4.0

# RUN \
# echo 'options(repos=c(CRAN="https://packagemanager.posit.co/cran/__linux__/bookworm/latest"))' >> ~/.Rprofile && \
# Rscript --vanilla -e 'getOption("repos")'

# Adding R packages
RUN install2.r Rcpp sna network networkDynamic Matrix MASS MatchIt SparseM igraph \
viridisLite covr testthat knitr rmarkdown ape RSiena survival RcppArmadillo

RUN install2.r languageserver httpgd

RUN apt-get update && apt-get install --no-install-recommends -y valgrind gdb \
libglpk-dev

CMD ["bash"]
36 changes: 36 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
{
"name": "epiworldR",
"build": {
"dockerfile": "Dockerfile"
},
"customizations": {
"vscode": {
"extensions": [
"reditorsupport.r",
"rdebugger.r-debugger",
"quarto.quarto",
"tianyishi.rmarkdown"
]
}
},
"mounts": [
// Mount the .vscode configuration into the container
"source=${localWorkspaceFolder}/.devcontainer/.vscode,target=/workspaces/${localWorkspaceFolderBasename}/.vscode,type=bind,consistency=cached"
]
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "gcc -v",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
29 changes: 29 additions & 0 deletions .github/workflows/r.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-latest, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-latest, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-latest, r: 'devel', valgrind: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
Expand Down Expand Up @@ -70,16 +71,44 @@ jobs:
shell: Rscript {0}

- name: Check
if: ${{ matrix.config.valgrind != true }}
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "error", check_dir = "check")
shell: Rscript {0}

- name: Setup valgrind
if: ${{ matrix.config.valgrind == true }}
run: |
sudo apt-get update
sudo apt-get install -y valgrind --no-install-recommends
shell: bash

- name: Check with Valgrind
if: ${{ matrix.config.valgrind == true }}
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--use-valgrind"), error_on = "error", check_dir = "check")
shell: Rscript {0}

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check

- name: Build the package
if: ${{ matrix.config.os == 'ubuntu-latest' && (matrix.config.r == 'release' || matrix.config.r == 'devel') && (matrix.config.valgrind != true) }}
run: R CMD build .

- uses: actions/upload-artifact@v4
if: ${{ matrix.config.os == 'ubuntu-latest' && (matrix.config.r == 'release' || matrix.config.r == 'devel') && (matrix.config.valgrind != true) }}
with:
name: netdiffuseR-built-package-${{ matrix.config.os }}-${{ matrix.config.r }}
path: netdiffuseR_*.tar.gz
retention-days: 7
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: netdiffuseR
Title: Analysis of Diffusion and Contagion Processes on Networks
Version: 1.22.7
Version: 1.23.0
Authors@R: c(
person("George", "Vega Yon", email="[email protected]", role=c("aut", "cre"),
comment=c(ORCID = "0000-0002-3171-0844", what="Rewrite functions with Rcpp, plus new features")
Expand Down Expand Up @@ -51,7 +51,7 @@ Suggests:
survival
VignetteBuilder: knitr
LinkingTo: Rcpp, RcppArmadillo
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Encoding: UTF-8
URL: https://github.com/USCCANA/netdiffuseR,
https://USCCANA.github.io/netdiffuseR/
Expand All @@ -64,6 +64,7 @@ Collate:
'adjmat.r'
'bass.r'
'bootnet.r'
'citer_environment.R'
'data.r'
'diffnet-c.R'
'diffnet-class.r'
Expand Down
33 changes: 18 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
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
help:
@echo "Makefile for netdiffuseR package"
@echo "Usage:"
@echo " make install - Install the package"
@echo " make build - Build the package source tarball"
@echo " make check - Check the package with R CMD check"
@echo " make checkv - Check the package with R CMD check using Valgrind"
@echo " make clean - Clean up the build artifacts"
@echo " make docs - Generate documentation"

install:
R CMD INSTALL .

build:
R CMD build .

inst/NEWS: NEWS.md
Rscript -e "rmarkdown::pandoc_convert('NEWS.md', 'plain', output='inst/NEWS')"&& \
head -n 80 inst/NEWS

README.md: README.Rmd
Rscript -e 'rmarkdown::render("README.Rmd")'

.PHONY: check checkv clean

check: netdiffuseR_$(VERSION).tar.gz
R CMD check --as-cran netdiffuseR_$(VERSION).tar.gz

checkv: netdiffuseR_$(VERSION).tar.gz
R CMD check --as-cran --use-valgrind netdiffuseR_$(VERSION).tar.gz

clean:
rm -rf netdiffuseR.Rcheck
rm -rf netdiffuseR.Rcheck src/*.so src/*.o

man/moran.Rd: R/* src/*.cpp src/*.h
Rscript --vanilla -e 'roxygen2::roxygenize()'
docs:
Rscript --vanilla -e 'devtools::document()'

.PHONY: check checkv clean install docs
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Changes in netdiffuseR version 1.23.0 (2025-06-10)

* New methods for simulating multi-diffusion models.

* It is now possible to simulate diffusions with general disadoption functions.


# Changes in netdiffuseR version 1.22.7 (2024-09-18)

* Minor changes to testing (skip warnings).
Expand Down
20 changes: 20 additions & 0 deletions R/citer_environment.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# file_version: f6ffa5cc103728c81c977e9101df287d
# citer_version: 0.0.9000
# DO NOT EDIT THIS BY HAND!
# This document was automatically generated by the `citer` package.
# tools::md5sum()

# Citer Environment Setup
citation_on_load <- function() {

pkg_name <- "netdiffuseR"

packageStartupMessage(
"Thank you for using ", pkg_name, "! ",
"Please consider citing it in your work.\n",
"You can find the citation information by running\n citation(\"",
pkg_name,
"\")"
)

}
Loading
Loading