diff --git a/.Rbuildignore b/.Rbuildignore new file mode 100644 index 0000000..428c455 --- /dev/null +++ b/.Rbuildignore @@ -0,0 +1,23 @@ +.hooks/ +WORDLIST$ +^.*.zip$ +^.*\.Rproj$ +^CONDUCT\.md$ +^CONTRIBUTING\.md$ +^README-.*\.png$ +^README\.Rmd$ +^README\.html$ +^\.Rproj\.user$ +^\.github$ +^\.pre-commit-config\.yaml$ +^_pkgdown\.yml$ +^aaa* +^codemeta\.json$ +^cran-comments.md$ +^inst/WORDLIST$ +^makefile$ +^temp* +^vignettes/makefile$ +data-raw/ +docs/ +scripts/ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..9315334 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,49 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +name: R-CMD-check + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + # - {os: macos-latest, r: 'release'} + # - {os: windows-latest, r: 'release'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + # - {os: ubuntu-latest, r: 'oldrel-1'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + steps: + - uses: actions/checkout@v3 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true diff --git a/.hooks/description b/.hooks/description new file mode 100755 index 0000000..2cb65f7 --- /dev/null +++ b/.hooks/description @@ -0,0 +1,16 @@ +#!/usr/bin/env Rscript + +# only stop on main branch +on_main <- identical (gert::git_branch (), "main") + +s <- gert::git_status() +chk <- ("DESCRIPTION" %in% s$file && + (s$status [s$file == "DESCRIPTION"] == "modified" | + s$status [s$file == "DESCRIPTION"] == "new")) +if (!chk & on_main) + stop ("DESCRIPTION has not been updated") + +f <- file.path (here::here(), "DESCRIPTION") +x <- system2 ("git", args = c ("diff", "--cached", "-U0", f), stdout = TRUE) +if (!any (grepl ("^\\+Version", x)) & on_main) + stop ("Version number in DESCRIPTION has not been incremented") diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..443128e --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,82 @@ +# All available hooks: https://pre-commit.com/hooks.html +# R specific hooks: https://github.com/lorenzwalthert/precommit +repos: +- repo: https://github.com/lorenzwalthert/precommit + rev: v0.4.2 + hooks: + - id: style-files + args: [--style_pkg=spaceout, --style_fun=spaceout_style] + additional_dependencies: + - ropensci-review-tools/spaceout + # - id: roxygenize + # codemeta must be above use-tidy-description when both are used + # - id: codemeta-description-updated + - id: use-tidy-description + - id: spell-check + exclude: > + (?x)^( + .*\.[rR]| + .*\.feather| + .*\.jpeg| + .*\.pdf| + .*\.png| + .*\.py| + .*\.RData| + .*\.rds| + .*\.Rds| + .*\.Rproj| + .*\.sh| + (.*/|)\.gitignore| + (.*/|)\.gitlab-ci\.yml| + (.*/|)\.lintr| + (.*/|)\.pre-commit-.*| + (.*/|)\.Rbuildignore| + (.*/|)\.Renviron| + (.*/|)\.Rprofile| + (.*/|)\.travis\.yml| + (.*/|)appveyor\.yml| + (.*/|)NAMESPACE| + (.*/|)renv/settings\.dcf| + (.*/|)renv\.lock| + (.*/|)WORDLIST| + \.github/workflows/.*| + data/.*| + )$ + # - id: lintr + - id: readme-rmd-rendered + - id: parsable-R + - id: no-browser-statement + - id: no-print-statement + - id: no-debug-statement + - id: deps-in-desc + # - id: pkgdown +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: check-added-large-files + args: ['--maxkb=200'] + - id: file-contents-sorter + files: '^\.Rbuildignore$' + - id: end-of-file-fixer + exclude: '\.Rd' +- repo: https://github.com/pre-commit-ci/pre-commit-ci-config + rev: v1.6.1 + hooks: + # Only required when https://pre-commit.ci is used for config validation + - id: check-pre-commit-ci-config +- repo: local + hooks: + - id: forbid-to-commit + name: Don't commit common R artifacts + entry: Cannot commit .Rhistory, .RData, .Rds or .rds. + language: fail + files: '\.(Rhistory|RData|Rds|rds)$' + # `exclude: ` to allow committing specific files + - id: description version + name: Version has been incremeneted in DESCRIPTION + entry: .hooks/description + language: script + +ci: + autoupdate_schedule: monthly + # skip: [pkgdown] diff --git a/DESCRIPTION b/DESCRIPTION new file mode 100644 index 0000000..c01ede5 --- /dev/null +++ b/DESCRIPTION @@ -0,0 +1,16 @@ +Package: naturoute +Title: Routing through natural spaces +Version: 0.0.0 +Authors@R: + person(given = "Mark", + family = "Padgham", + role = c("aut", "cre"), + email = "mark.padgham@email.com") +Description: Routing through natural spaces. +License: GPL-3 +URL: https://github.com/UrbanAnalyst/naturoute +BugReports: https://github.com/UrbanAnalyst/naturoute/issues +Encoding: UTF-8 +LazyData: true +Roxygen: list(markdown = TRUE) +RoxygenNote: 7.3.1 diff --git a/NAMESPACE b/NAMESPACE new file mode 100644 index 0000000..e651b94 --- /dev/null +++ b/NAMESPACE @@ -0,0 +1 @@ +# Generated by roxygen2: do not edit by hand diff --git a/R/naturoute-package.R b/R/naturoute-package.R new file mode 100644 index 0000000..3404661 --- /dev/null +++ b/R/naturoute-package.R @@ -0,0 +1,9 @@ +#' @keywords internal +#' @aliases naturoute-package +"_PACKAGE" + +# The following block is used by usethis to automatically manage +# roxygen namespace tags. Modify with care! +## usethis namespace: start +## usethis namespace: end +NULL diff --git a/README.Rmd b/README.Rmd new file mode 100644 index 0000000..35cf887 --- /dev/null +++ b/README.Rmd @@ -0,0 +1,32 @@ +--- +title: "naturoute" +output: + md_document: + variant: markdown_github + + rmarkdown::html_vignette: + self_contained: no +--- + + + +```{r opts, echo = FALSE} +knitr::opts_chunk$set ( + collapse = TRUE, + warning = TRUE, + message = TRUE, + width = 120, + comment = "#>", + fig.retina = 2, + fig.path = "README-" +) +``` + +[![R build +status](https://github.com/UrbanAnalyst/naturoute/workflows/R-CMD-check/badge.svg)](https://github.com/UrbanAnalyst/naturoute/actions?query=workflow%3AR-CMD-check) +[![Project Status: Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) + + +# naturoute + +Routing through natural spaces. diff --git a/README.md b/README.md new file mode 100644 index 0000000..adc4c05 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ + + +[![R build +status](https://github.com/UrbanAnalyst/naturoute/workflows/R-CMD-check/badge.svg)](https://github.com/UrbanAnalyst/naturoute/actions?query=workflow%3AR-CMD-check) +[![Project Status: +Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) + +# naturoute + +Routing through natural spaces. diff --git a/codemeta.json b/codemeta.json new file mode 100644 index 0000000..da1e69e --- /dev/null +++ b/codemeta.json @@ -0,0 +1,39 @@ +{ + "@context": "https://doi.org/10.5063/schema/codemeta-2.0", + "@type": "SoftwareSourceCode", + "identifier": "naturoute", + "description": "Routing through natural spaces.", + "name": "naturoute: Routing through natural spaces", + "codeRepository": "https://github.com/UrbanAnalyst/naturoute", + "issueTracker": "https://github.com/UrbanAnalyst/naturoute/issues", + "license": "https://spdx.org/licenses/GPL-3.0", + "version": "0.0.0", + "programmingLanguage": { + "@type": "ComputerLanguage", + "name": "R", + "url": "https://r-project.org" + }, + "runtimePlatform": "R version 4.4.0 (2024-04-24)", + "author": [ + { + "@type": "Person", + "givenName": "Mark", + "familyName": "Padgham", + "email": "mark.padgham@email.com" + } + ], + "maintainer": [ + { + "@type": "Person", + "givenName": "Mark", + "familyName": "Padgham", + "email": "mark.padgham@email.com" + } + ], + "softwareRequirements": { + "SystemRequirements": null + }, + "fileSize": "1.711KB", + "contIntegration": "https://github.com/UrbanAnalyst/naturoute/actions?query=workflow%3AR-CMD-check", + "developmentStatus": "https://www.repostatus.org/#active" +} diff --git a/makefile b/makefile new file mode 100644 index 0000000..0afc931 --- /dev/null +++ b/makefile @@ -0,0 +1,29 @@ +RFILE = README +VIGNETTE = parallel + +all: init vignette + +init: + echo "pkgdown::init_site()" | R --no-save -q + +site: + echo "pkgdown::build_site()" | R --no-save q + +vignette: + echo "pkgdown::build_article('$(VIGNETTE)',quiet=FALSE)" | R --no-save -q + +knith: $(RFILE).Rmd + echo "rmarkdown::render('$(RFILE).Rmd',output_file='$(RFILE).html')" | R --no-save -q + +doc: clean + Rscript -e 'devtools::document()' + Rscript -e 'rmarkdown::render("$(RFILE).Rmd",rmarkdown::md_document(variant="gfm"))' + +open: + xdg-open docs/articles/$(VIGNETTE).html & + +check: + Rscript -e 'library(pkgcheck); checks <- pkgcheck(); print(checks); summary (checks)' + +clean: + rm -rf *.html *.png README_cache docs/ diff --git a/man/naturoute-package.Rd b/man/naturoute-package.Rd new file mode 100644 index 0000000..83cde5d --- /dev/null +++ b/man/naturoute-package.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/naturoute-package.R +\docType{package} +\name{naturoute-package} +\alias{naturoute} +\alias{naturoute-package} +\title{naturoute: Routing through natural spaces} +\description{ +Routing through natural spaces. +} +\seealso{ +Useful links: +\itemize{ + \item \url{https://github.com/UrbanAnalyst/naturoute} + \item Report bugs at \url{https://github.com/UrbanAnalyst/naturoute/issues} +} + +} +\author{ +\strong{Maintainer}: Mark Padgham \email{mark.padgham@email.com} + +} +\keyword{internal}