Skip to content

Commit 3ca80a4

Browse files
Scaffold cd package with usethis
Initial package structure: DESCRIPTION, testthat 3e, pkgdown, planning directories, dev/dev.R scaffold recipe. Imports: dplyr, jsonlite, rappdirs, rlang, sf, terra, tibble Suggests: aws.s3, ecmwfr, ggplot2, gt, Kendall, knitr, rmarkdown, bookdown, zyp Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 parents  commit 3ca80a4

15 files changed

Lines changed: 202 additions & 0 deletions

File tree

.Rbuildignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
^LICENSE\.md$
2+
^_pkgdown\.yml$
3+
^docs$
4+
^pkgdown$
5+
^\.github$

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

.github/workflows/pkgdown.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
release:
8+
types: [published]
9+
workflow_dispatch:
10+
11+
name: pkgdown.yaml
12+
13+
permissions: read-all
14+
15+
jobs:
16+
pkgdown:
17+
runs-on: ubuntu-latest
18+
# Only restrict concurrency for non-PR jobs
19+
concurrency:
20+
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
21+
env:
22+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
23+
permissions:
24+
contents: write
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- uses: r-lib/actions/setup-pandoc@v2
29+
30+
- uses: r-lib/actions/setup-r@v2
31+
with:
32+
use-public-rspm: true
33+
34+
- uses: r-lib/actions/setup-r-dependencies@v2
35+
with:
36+
extra-packages: any::pkgdown, local::.
37+
needs: website
38+
39+
- name: Build site
40+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
41+
shell: Rscript {0}
42+
43+
- name: Deploy to GitHub pages 🚀
44+
if: github.event_name != 'pull_request'
45+
uses: JamesIves/github-pages-deploy-action@v4.5.0
46+
with:
47+
clean: false
48+
branch: gh-pages
49+
folder: docs

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.Rproj.user
2+
.Rhistory
3+
.RData
4+
.Ruserdata
5+
inst/doc
6+
docs
7+
/doc/
8+
/Meta/
9+
vignettes/*.html

.lintr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
linters: linters_with_defaults(line_length_linter(120), object_name_linter(styles = c("snake_case", "dotted.case")), commented_code_linter = NULL)

DESCRIPTION

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Package: cd
2+
Title: Climate Departure Analysis from ERA5-Land Reanalysis
3+
Version: 0.0.0.9000
4+
Authors@R: c(
5+
person("Allan", "Irvine", , "al@newgraphenvironment.com", role = c("aut", "cre"),
6+
comment = c(ORCID = "0000-0002-3495-2128")),
7+
person("New Graph Environment Ltd.", role = "cph")
8+
)
9+
Description: Compute climate anomalies from ERA5-Land reanalysis data for
10+
custom areas of interest. Producer functions download ERA5-Land
11+
monthly means, derive variables (VPD, RH, soil moisture), and publish
12+
Cloud-Optimized GeoTIFFs with a static STAC catalog. Consumer
13+
functions query the catalog, crop to AOI, compute baselines and
14+
anomalies for arbitrary reference periods, and run trend analysis
15+
(Mann-Kendall and Theil-Sen).
16+
License: MIT + file LICENSE
17+
URL: https://github.com/NewGraphEnvironment/cd
18+
BugReports: https://github.com/NewGraphEnvironment/cd/issues
19+
Depends:
20+
R (>= 4.1)
21+
Encoding: UTF-8
22+
Roxygen: list(markdown = TRUE)
23+
RoxygenNote: 7.3.3
24+
Suggests:
25+
aws.s3,
26+
bookdown,
27+
ecmwfr,
28+
ggplot2,
29+
gt,
30+
Kendall,
31+
knitr,
32+
rmarkdown,
33+
testthat (>= 3.0.0),
34+
zyp
35+
Config/testthat/edition: 3
36+
Imports:
37+
dplyr,
38+
jsonlite,
39+
rappdirs,
40+
rlang,
41+
sf,
42+
terra,
43+
tibble

LICENSE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
YEAR: 2026
2+
COPYRIGHT HOLDER: New Graph Environment Ltd.

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# MIT License
2+
3+
Copyright (c) 2026 New Graph Environment Ltd.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

NAMESPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Generated by roxygen2: do not edit by hand
2+

R/cd-package.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#' @keywords internal
2+
"_PACKAGE"

0 commit comments

Comments
 (0)