Skip to content

Commit cdb75fa

Browse files
authored
Merge pull request #140 from aim-rsf/rOpenSci
Changes needed for rOpenSci submission
2 parents 51e006c + 45e5c10 commit cdb75fa

File tree

91 files changed

+1964
-1410
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+1964
-1410
lines changed

.Rbuildignore

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515

1616

1717

18+
^codemeta\.json$

.github/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

.github/workflows/R-CMD-check.yaml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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+
8+
name: R-CMD-check.yaml
9+
10+
permissions: read-all
11+
12+
jobs:
13+
R-CMD-check:
14+
runs-on: ${{ matrix.config.os }}
15+
16+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
config:
22+
- {os: macos-latest, r: 'release'}
23+
- {os: windows-latest, r: 'release'}
24+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
25+
- {os: ubuntu-latest, r: 'release'}
26+
- {os: ubuntu-latest, r: 'oldrel-1'}
27+
28+
env:
29+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
30+
R_KEEP_PKG_SOURCE: yes
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- uses: r-lib/actions/setup-pandoc@v2
36+
37+
- uses: r-lib/actions/setup-r@v2
38+
with:
39+
r-version: ${{ matrix.config.r }}
40+
http-user-agent: ${{ matrix.config.http-user-agent }}
41+
use-public-rspm: true
42+
43+
- name: Update Homebrew
44+
if: matrix.config.os == 'macos-latest'
45+
run: brew update
46+
47+
- name: Install Dependencies
48+
if: matrix.config.os == 'macos-latest'
49+
run: |
50+
brew install gcc
51+
brew install qpdf
52+
53+
- uses: r-lib/actions/setup-r-dependencies@v2
54+
with:
55+
extra-packages: any::rcmdcheck
56+
needs: check
57+
58+
- name: Check R package (macOS and Linux)
59+
if: matrix.config.os != 'windows-latest'
60+
run: |
61+
R CMD check --no-manual --as-cran > check.log 2>&1 || true
62+
cat check.log
63+
grep -q -E "WARNING" check.log && exit 1 || true
64+
65+
- name: Check R package (Windows)
66+
if: matrix.config.os == 'windows-latest'
67+
shell: cmd
68+
run: |
69+
R CMD check --no-manual --as-cran > check.log 2>&1 || true
70+
type check.log
71+
findstr /i "WARNING" check.log && exit 1 || true

.github/workflows/test-coverage.yaml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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+
8+
name: test-coverage.yaml
9+
10+
permissions: read-all
11+
12+
jobs:
13+
test-coverage:
14+
runs-on: ubuntu-latest
15+
env:
16+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: r-lib/actions/setup-r@v2
22+
with:
23+
use-public-rspm: true
24+
25+
- uses: r-lib/actions/setup-r-dependencies@v2
26+
with:
27+
extra-packages: any::covr, any::xml2
28+
needs: coverage
29+
30+
- name: Test coverage
31+
run: |
32+
cov <- covr::package_coverage(
33+
quiet = FALSE,
34+
clean = FALSE,
35+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
36+
)
37+
covr::to_cobertura(cov)
38+
shell: Rscript {0}
39+
40+
- uses: codecov/codecov-action@v4
41+
with:
42+
# Fail if error if not on PR, or if on PR and token is given
43+
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
44+
file: ./cobertura.xml
45+
plugin: noop
46+
disable_search: true
47+
token: ${{ secrets.CODECOV_TOKEN }}
48+
49+
- name: Show testthat output
50+
if: always()
51+
run: |
52+
## --------------------------------------------------------------------
53+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
54+
shell: bash
55+
56+
- name: Upload test results
57+
if: failure()
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: coverage-test-failures
61+
path: ${{ runner.temp }}/package
+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
2+
# The action runs when:
3+
# - A new release is published
4+
# - The DESCRIPTION or inst/CITATION are modified
5+
# - Can be run manually
6+
# For customizing the triggers, visit https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
7+
on:
8+
release:
9+
types: [published]
10+
push:
11+
branches: [master, main]
12+
paths:
13+
- DESCRIPTION
14+
- inst/CITATION
15+
workflow_dispatch:
16+
17+
name: Update CITATION.cff
18+
19+
jobs:
20+
update-citation-cff:
21+
runs-on: macos-latest
22+
env:
23+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
24+
steps:
25+
- uses: actions/checkout@v3
26+
- uses: r-lib/actions/setup-r@v2
27+
- uses: r-lib/actions/setup-r-dependencies@v2
28+
with:
29+
extra-packages: |
30+
any::cffr
31+
any::V8
32+
33+
- name: Update CITATION.cff
34+
run: |
35+
36+
library(cffr)
37+
38+
# Customize with your own code
39+
# See https://docs.ropensci.org/cffr/articles/cffr.html
40+
41+
# Write your own keys
42+
mykeys <- list()
43+
44+
# Create your CITATION.cff file
45+
cff_write(keys = mykeys)
46+
47+
shell: Rscript {0}
48+
49+
- name: Commit results
50+
run: |
51+
git config --local user.name "github-actions[bot]"
52+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
53+
git add CITATION.cff
54+
git commit -m 'Update CITATION.cff' || echo "No changes to commit"
55+
git push origin || echo "No changes to commit"
56+
57+
58+

DESCRIPTION

+19-9
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,26 @@ Type: Package
22
Package: browseMetadata
33
Title: Browse and categorise health metadata
44
Version: 1.2.2
5-
Authors@R:
6-
person("Rachael", "Stickland", , "rstickland@turing.ac.uk", role = c("aut", "cre"),
7-
comment = c(ORCID = "0000-0003-3398-4272"))
5+
Authors@R: c(
6+
person("Rachael", "Stickland", , "rstickland@turing.ac.uk",
7+
role = c("aut", "cre"),
8+
comment = c(ORCID = "0000-0003-3398-4272")),
9+
person("Batool", "Almarzouq", , , role = "ctb",
10+
comment = c(ORCID = "0000-0002-3905-2751")),
11+
person("Mahwish", "Mohammad", , , role = "ctb",
12+
comment = c(ORCID = "0009-0004-5295-0726")),
13+
person("Daniel", "Delbarre", , , role = "ctb",
14+
comment = c(ORCID = "0000-0003-4633-4252")),
15+
person("Nida", "Ziauddeen", , , role = "ctb",
16+
comment = c(ORCID = "0000-0002-8964-5029"))
17+
)
818
Maintainer: Rachael Stickland <rstickland@turing.ac.uk>
9-
Description: This R package helps a researcher browse datasets in SAIL databank.
10-
It has scope to be applied to other health datasets.
11-
It is useful in the earlier stages of a project; prior to data access,
12-
researchers can use the metadata to browse and categorise variables.
19+
Description: Visualise and categorise publicly available metadata from health
20+
datasets. By interacting with metadata prior to gaining full access to health
21+
datasets, researchers can use this tool to browse datasets and categorise
22+
variables.
1323
License: GPL (>= 3)
14-
URL: https://aim-rsf.github.io/browseMetadata
24+
URL: https://aim-rsf.github.io/browseMetadata/
1525
Depends:
1626
R (>= 2.10)
1727
Imports:
@@ -21,7 +31,7 @@ Imports:
2131
gridExtra,
2232
htmlwidgets,
2333
plotly,
24-
rjson,
34+
jsonlite,
2535
tidyr
2636
Suggests:
2737
knitr,

NAMESPACE

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Generated by roxygen2: do not edit by hand
22

3-
export(browseMetadata)
4-
export(mapMetadata)
5-
export(mapMetadata_compare_outputs)
6-
export(mapMetadata_convert_outputs)
3+
export(browse_metadata)
4+
export(map_metadata)
5+
export(map_metadata_compare)
6+
export(map_metadata_convert)
77
import(ggplot2)
88
importFrom(cli,cli_alert_danger)
99
importFrom(cli,cli_alert_info)
@@ -27,9 +27,9 @@ importFrom(graphics,plot.new)
2727
importFrom(gridExtra,grid.arrange)
2828
importFrom(gridExtra,tableGrob)
2929
importFrom(htmlwidgets,saveWidget)
30+
importFrom(jsonlite,fromJSON)
3031
importFrom(plotly,layout)
3132
importFrom(plotly,plot_ly)
32-
importFrom(rjson,fromJSON)
3333
importFrom(stats,reorder)
3434
importFrom(tidyr,complete)
3535
importFrom(tidyr,pivot_longer)

R/browseMetadata-package.R

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#' @keywords internal
2+
"_PACKAGE"
3+
4+
## usethis namespace: start
5+
## usethis namespace: end
6+
NULL

0 commit comments

Comments
 (0)