Skip to content

Commit

Permalink
Merge with main (2024-05-23)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjentsch committed May 23, 2024
2 parents ced788d + a65fd11 commit 4ffcd26
Show file tree
Hide file tree
Showing 73 changed files with 2,010 additions and 830 deletions.
22 changes: 22 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
^add_docs
^doc$
^docs$
^pkgdown$
^TrialSPSS
^TrialOMV
^TrialOther
^LICENSE$
^Meta$
^README\.Rmd$
^jmvReadWrite.svg$
^.*\.Rproj$
^\.Rproj\.user$
^\.github$
^\.lintr$
^.prepare4CRAN$
^_pkgdown\.yml$
^CONTRIBUTING.md$
^cran-comments\.md$
^CRAN-RELEASE$
^CRAN-SUBMISSION$
^codemeta\.json$
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# If you find this module useful, please donate to the jamovi project.
patreon: jamovi
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml → .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Run CI for R using https://eddelbuettel.github.io/r-ci/

name: ci
name: CI

on:
push:
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main]
branches: ['**']
pull_request:
branches: [main]
branches: [main, master]

name: R-CMD-check

Expand All @@ -22,7 +22,7 @@ jobs:
- {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'}
# - {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -45,9 +45,13 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
extra-packages: any::rcmdcheck, any::XML, any::roxygen2, github::jamovi/jmvcore
needs: check

- name: Document
run: roxygen2::roxygenise(roclets = "rd")
shell: Rscript {0}

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
28 changes: 28 additions & 0 deletions .github/workflows/pkgcheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: pkgcheck

# This will cancel running jobs once a new run is triggered
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

on:
# Manually trigger the Action under Actions/pkgcheck
workflow_dispatch:
# Run on every push to main
push:
branches:
- main
env:
ACTIONS_RUNNER_DEBUG: true
ACTIONS_STEP_DEBUG: true
NO_CHKDIR: true

jobs:
pkgcheck:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: ropensci-review-tools/pkgcheck-action@main
with:
post-to-issue: false
97 changes: 97 additions & 0 deletions .github/workflows/rhub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# R-hub's generic GitHub Actions workflow file. It's canonical location is at
# https://github.com/r-hub/actions/blob/v1/workflows/rhub.yaml
# You can update this file to a newer version using the rhub2 package:
#
# rhub::rhub_setup()
#
# It is unlikely that you need to modify this file manually.

name: R-hub
run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}"

on:
workflow_dispatch:
inputs:
config:
description: 'A comma separated list of R-hub platforms to use.'
type: string
default: 'linux,windows,macos,macos-arm64'
name:
description: 'Run name.'
type: string
default: 'manually started run'
id:
description: 'Unique ID. You can leave this empty now.'
type: string
default: 'rhub'

jobs:

setup:
runs-on: ubuntu-latest
outputs:
containers: ${{ steps.rhub-setup.outputs.containers }}
platforms: ${{ steps.rhub-setup.outputs.platforms }}

steps:
# NO NEED TO CHECKOUT HERE
- uses: r-hub/actions/setup@v1
with:
config: ${{ github.event.inputs.config }}
id: rhub-setup

linux-containers:
needs: setup
if: ${{ needs.setup.outputs.containers != '[]' }}
runs-on: ubuntu-latest
name: ${{ matrix.config.label }}
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.setup.outputs.containers) }}
container:
image: ${{ matrix.config.container }}

steps:
- uses: r-hub/actions/checkout@v1
- uses: r-hub/actions/platform-info@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/setup-deps@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/run-check@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}

other-platforms:
needs: setup
if: ${{ needs.setup.outputs.platforms != '[]' }}
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.label }}
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.setup.outputs.platforms) }}

steps:
- uses: r-hub/actions/checkout@v1
- uses: r-hub/actions/setup-r@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
- uses: r-hub/actions/platform-info@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/setup-deps@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
- uses: r-hub/actions/run-check@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ pkgdown/

# R Environment Variables
.Renviron
.Rbuildignore

# pkgdown site
docs/
Expand Down
2 changes: 1 addition & 1 deletion .lintr
Original file line number Diff line number Diff line change
@@ -1 +1 @@
linters: lintr::linters_with_defaults(line_length_linter = NULL, object_name_linter = NULL, commented_code_linter = NULL, indentation_linter = NULL)
linters: lintr::linters_with_defaults(line_length_linter = NULL, object_name_linter = NULL, commented_code_linter = NULL, indentation_linter = NULL, cyclocomp_linter(complexity_limit = 30L))
31 changes: 17 additions & 14 deletions .prepare4CRAN
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ OR
devtools::load_all()

for (blnAtt in c(TRUE, FALSE)) {
for (crrOMV in list.files('inst/extdata/')) {
for (crrOMV in list.files('inst/extdata/', '*.omv')) {
cat(sprintf('\n%s\n\n%s\n\n', strrep("=", 100), crrOMV))
data <- read_omv(file.path('inst/extdata/', crrOMV), sveAtt = blnAtt)
write_omv(data, "~/Trial.omv")
data2 <- read_omv("~/Trial.omv", sveAtt = blnAtt)
cat(sprintf('\n%s\n\n%s\n\n', strrep("=", 100), crrOMV))
suppressWarnings(print(diffdf::diffdf(data, data2)))
unlink("~/Trial.omv")
rm("data", "data2")
Expand All @@ -19,8 +19,7 @@ rm('blnAtt', 'crrOMV')

# checks the requirements (all dependencies up-to-date, etc.)
# use devtools::update_packages("devtools") and devtools::install_dev_deps() if required
# NB: there might be an error when updating the tidyverse-packages: remove the APA-style
# formatting in .Rprofile, restart R and put it back afterwards
# NB: there might be an error when updating the tidyverse-packages: start R with R --no-init-file
devtools::dev_sitrep()

# do some initial checks
Expand All @@ -37,14 +36,15 @@ devtools::lint()
devtools::test()
devtools::test_coverage()
# once happy with the coverage, it can be uploaded using
covr::codecov(token = "2f521d97-d1e2-4baf-b05b-0b569a7c6f0f")
covr::codecov(token = "2f521d97-d1e2-4baf-b05b-0b569a7c6f0f") # jmvReadWrite
covr::codecov(token = "821f2b2f-e305-49b2-ab96-7f328530f6ed") # jTransform

# ================================================================================================================================================
# REMEMBER: error messages from R are not always pointing to the place where the error occurs - especially when using commands like build_readme()
# ================================================================================================================================================

# update version number in DESCRIPTION and NEWS.md (and changes in NEWS.md)
system("gedit DESCRIPTION NEWS.md inst/CITATION")
# update version number in DESCRIPTION and NEWS.md (and changes in NEWS.md)$(git log --date=format:'%Y-%m-%d' | grep -m1 "^Date" | sed 's/Date:\s*//')"
system("gedit DESCRIPTION NEWS.md inst/CITATION") # jmvReadWrite

# building / updating README, PDF manual, and the HTML documentation
# add new functions to _pkgdown.yaml and to vignettes/jmvReadWrite.Rmd if required
Expand All @@ -64,17 +64,20 @@ devtools::check(force_suggests = TRUE, incoming = TRUE, remote = TRUE, env_vars
devtools::check_win_devel()

# the next stage of ping-pong, either build on the standard platforms
devtools::check_rhub()
# or builds it the package on rhub using all major platforms R is supported on
devtools::check_rhub(pkg = ".", platforms = rhub::platforms()$name, env_vars = c("_R_CHECK_FORCE_SUGGESTS_" = "false"))
# or, if there are known errors (e.g., on rhub), exclude certain platforms explicitly
crrPlt = rhub::platforms()
crrPlt = crrPlt[-c(x, ...), ]
devtools::check_rhub(pkg = ".", platforms = crrPlt$name, env_vars = c("_R_CHECK_FORCE_SUGGESTS_" = "false"))
#rhub::rc_submit(platforms=c("linux", "windows", "macos", "macos-arm64"))
rhub::rhub_check(platforms=c("linux", "windows", "macos", "macos-arm64"))
# running github actions requires a personal access token: https://github.com/settings/profile
# → Developer options → Personal access token → Tokens (classic) → tick “repo”
# the token is valid for a limited time period and can be regenerated; to update the
# token, the following function can be used (choose 2 and copy the token when requested)
gitcreds::gitcreds_set()

# update version number and comments in cran-comments.md (and perhaps NEWS.md)
system("gedit cran-comments.md NEWS.md")

# update codemeta.json (devtools::release() asks for it)
codemetar::write_codemeta()

# now, we are ready to release the package onto CRAN
devtools::release()

Expand Down
24 changes: 24 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Contributing to jmvReadWrite

## Opening issues

The easiest way to note any behavioural curiosities or to request new features
is by opening an [issue](https://github.com/sjentsch/jmvReadWrite/issues).


## Development guidelines

If you'd like to contribute changes to `jmvReadWrite`, the [GitHub
flow](https://docs.github.com/en/get-started/quickstart/github-flow) is used
for proposing, submitting, reviewing, and accepting changes. If you haven't
done this before, there's a nice [overview of
git](https://r-pkgs.org/git.html), as well as [best practices for submitting
pull requests](http://r-pkgs.org/git.html#pr-make) in the R packages book by
Hadley Wickham and Jenny Bryan.

You are also welcome to contribute further checks / tests to `jmvReadWrite`.
Please discuss any proposed new checks by opening an issue on the GitHub
repository.

The `jmvReadWrite` coding style follows the commonly used [tidyverse style
guide](https://style.tidyverse.org/syntax.html#spacing).
11 changes: 5 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
Package: jmvReadWrite
Title: Read and Write 'jamovi' Files ('.omv')
Version: 0.4.0
Author: Sebastian Jentschke [aut, cre]
(<https://orcid.org/0000-0003-2576-5432>)
Version: 0.4.6
Author: Sebastian Jentschke [aut, cre, cph] (<https://orcid.org/0000-0003-2576-5432>)
Authors@R:
person(given = "Sebastian", family = "Jentschke", role = c("aut", "cre"), email = "sebastian.jentschke@uib.no", comment = c(ORCID = "0000-0003-2576-5432"))
person(given = "Sebastian", family = "Jentschke", role = c("aut", "cre", "cph"), email = "sebastian.jentschke@uib.no", comment = c(ORCID = "0000-0003-2576-5432"))
Maintainer: Sebastian Jentschke <sebastian.jentschke@uib.no>
Description: The free and open a statistical spreadsheet 'jamovi'
(<https://www.jamovi.org>) aims to make statistical analyses easy and
Expand All @@ -13,12 +12,12 @@ Description: The free and open a statistical spreadsheet 'jamovi'
the data files 'jamovi' produces ('.omv') permits an easy transfer of
data and analyses between 'jamovi' and R.
License: AGPL-3
Language: en-GB
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
VignetteBuilder: knitr
Language: en-GB
URL: https://sjentsch.github.io/jmvReadWrite/
BugReports: https://github.com/sjentsch/jmvReadWrite/issues
Depends: R (>= 3.5.0)
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
export(arrange_cols_omv)
export(convert_to_omv)
export(describe_omv)
export(label_vars_omv)
export(long2wide_omv)
export(merge_cols_omv)
export(merge_rows_omv)
Expand Down
Loading

0 comments on commit 4ffcd26

Please sign in to comment.