Skip to content

Commit

Permalink
Fix citation; add R-CMD-check
Browse files Browse the repository at this point in the history
  • Loading branch information
larnsce committed Sep 19, 2023
1 parent 95ef3f0 commit df495b3
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 50 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
^_pkgdown\.yml$
^docs$
^pkgdown$
^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
49 changes: 49 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -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
18 changes: 0 additions & 18 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,6 @@ authors:
- family-names: Kramer
given-names: Sasha
email: [email protected]
preferred-citation:
type: generic
title: 'cbssuitabilityhaiti: The Package contains data from the Soil projects in
Haiti'
authors:
- family-names: Loos
given-names: Sebastian Camilo
email: [email protected]
orcid: https://orcid.org/0000-0003-2196-5015
- family-names: Lubeck-Schricker
given-names: Maya
email: [email protected]
- family-names: Kramer
given-names: Sasha
email: [email protected]
year: '2023'
abstract: What the package does (one paragraph).
version: 0.0.0.9000
date-released: '2023-09-19'
contact:
- family-names: Loos
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ library(cbssuitabilityhaiti)
[![DOI](ZENODO_DOI_URL.svg)](ZENODO_DOI_URL)
[![R-CMD-check](https://github.com/openwashdata/cbssuitabilityhaiti/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/openwashdata/cbs suitabilityhaiti/actions/workflows/R-CMD-check.yaml)
[![License: CC BY 4.0](https://img.shields.io/badge/License-CC_BY_4.0-lightgrey.svg)](https://creativecommons.org/licenses/by/4.0/)

[![R-CMD-check](https://github.com/openwashdata/cbssuitabilityhaiti/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/openwashdata/cbssuitabilityhaiti/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

The goal of `cbssuitabiility` is to provide datasets for research and
Expand Down
28 changes: 0 additions & 28 deletions data-raw/data_processing.R
Original file line number Diff line number Diff line change
Expand Up @@ -146,31 +146,3 @@ dictionary <- get_variable_info(data = list(okap, mwater),
# dictionary |>
# openxlsx::write.xlsx("data-raw/dictionary.xlsx")

# install.packages("cffr")
library(cffr)

packageVersion("cffr")

# Hard code doi
# doi <- "10.5281/zenodo.6470427"

# creates CFF with all author roles
mod_cff <- cff_create("DESCRIPTION",
dependencies = FALSE,
keys = list(#"doi" = doi,
"date-released" = Sys.Date()))

# writes the CFF file
cff_write(mod_cff)

# Now write a CITATION file from the CITATION.cff file
# Use inst/CITATION instead (the default if not provided)
path_cit <- file.path("inst/CITATION")

write_citation("CITATION.cff", file = path_cit)

# By last, read the citation
cat(readLines(path_cit), sep = "\n")

# Start of inst/CITATION
utils::readCitationFile("inst/CITATION")
32 changes: 32 additions & 0 deletions data-raw/package_processing.R
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,35 @@ usethis::use_pkgdown()

# Build pkgdown website
pkgdown::build_site()

# install.packages("cffr")
library(cffr)

packageVersion("cffr")

# Hard code doi
# doi <- "10.5281/zenodo.6470427"

# creates CFF with all author roles
mod_cff <- cff_create("DESCRIPTION",
dependencies = FALSE,
keys = list(#"doi" = doi,
"date-released" = Sys.Date()))

# Remove the preferred-citation key
mod_cff$`preferred-citation` <- NULL

# writes the CFF file
cff_write(mod_cff)

# Now write a CITATION file from the CITATION.cff file
# Use inst/CITATION instead (the default if not provided)
path_cit <- file.path("inst/CITATION")

write_citation("CITATION.cff", file = path_cit)

# By last, read the citation
cat(readLines(path_cit), sep = "\n")

# Start of inst/CITATION
utils::readCitationFile("inst/CITATION")
6 changes: 3 additions & 3 deletions inst/CITATION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

bibentry(bibtype = "Misc",
key = "looslubeckschricker:2023",
title = "cbssuitabilityhaiti: The Package contains data from the Soil projects in Haiti",
key = "looslubeckschricker",
title = "cbssuitabilityhaiti: This package contains data for a sanitation zoning assessment done for the city of Cap Haitien, Haiti. It combines two datasets used for an analysis of the suitability of container-based sanitation (CBS).",
author = c(person(given = "Sebastian Camilo",
family = "Loos"),
person(given = "Maya",
Expand All @@ -10,4 +10,4 @@ bibentry(bibtype = "Misc",
family = "Kramer")),
year = "2023",
abstract = "What the package does (one paragraph).",
version = "0.0.0.9000")
version = "0.0.1")

0 comments on commit df495b3

Please sign in to comment.