Skip to content

Commit

Permalink
getting more ready for CRAN (#217)
Browse files Browse the repository at this point in the history
* check if remotes are needed

- version bump for CRAN
- update NEWS
- update GHA to v2

* also bump pkgdown GHA to v2

* use cran version for snapshots

* platform specific snaps

* minor

* fix remaining issues

* fix?
  • Loading branch information
IndrajeetPatil authored Jan 24, 2022
1 parent 3ae96a2 commit 05bc6da
Show file tree
Hide file tree
Showing 34 changed files with 162 additions and 292 deletions.
97 changes: 25 additions & 72 deletions .github/workflows/R-check.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# 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:
- master
branches: [main, master]
pull_request:
branches:
- master
branches: [main, master]

name: R-check
name: R-CMD-check

jobs:
R-CMD-check:
Expand All @@ -18,85 +19,37 @@ jobs:
fail-fast: false
matrix:
config:
#- {os: macOS-latest, r: 'devel'}
- {os: macOS-latest, r: 'release'}
#- {os: macOS-latest, r: 'oldrel-1'}

- {os: windows-latest, r: 'devel'}
- {os: macOS-latest, r: 'devel'}
- {os: ubuntu-18.04, r: 'devel'}
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'oldrel-1'}

# Use older ubuntu to maximise backward compatibility
- {os: ubuntu-18.04, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-18.04, r: 'release'}
- {os: windows-latest, r: 'oldrel'}
#- {os: macOS-latest, r: 'oldrel'}
- {os: ubuntu-18.04, r: 'oldrel'}
- {os: ubuntu-18.04, r: '3.6.0'}
- {os: ubuntu-18.04, r: '3.5.0'}
- {os: ubuntu-18.04, r: '3.4.0'}
- {os: ubuntu-18.04, r: 'oldrel-1'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@master
- 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-pandoc@master

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}
extra-packages: any::rcmdcheck
needs: check

- name: Check
env:
_R_CHECK_CRAN_INCOMING_: false
_R_CHECK_FORCE_SUGGESTS_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload check results
if: failure()
uses: actions/upload-artifact@master
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
- uses: r-lib/actions/check-r-package@v2
58 changes: 24 additions & 34 deletions .github/workflows/pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,41 @@
# 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: master
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
runs-on: macOS-latest
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@master
- uses: r-lib/actions/setup-pandoc@v2-branch

- uses: r-lib/actions/setup-pandoc@master

- uses: r-lib/actions/setup-tinytex@v1

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v1
- uses: r-lib/actions/setup-r@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
use-public-rspm: true

- name: Install dependencies
run: |
install.packages("remotes")
# To get links for homepage
remotes::install_cran("devtools")
remotes::install_deps(dependencies = TRUE)
remotes::install_dev("pkgdown")
shell: Rscript {0}
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: r-lib/pkgdown, local::.
needs: website

- name: Install package
run: R CMD INSTALL .
- name: Build site
run: Rscript -e 'pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)'

- name: Deploy package
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE, clean = TRUE)'
- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: docs
9 changes: 1 addition & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: report
Title: Automated Reporting of Results and Statistical Models
Version: 0.4.0.1
Version: 0.5.0
Authors@R:
c(person(given = "Dominique",
family = "Makowski",
Expand Down Expand Up @@ -121,10 +121,3 @@ Collate:
'utils_error_message.R'
'utils_grouped_df.R'
Roxygen: list(markdown = TRUE)
Remotes:
easystats/insight,
easystats/datawizard,
easystats/performance,
easystats/parameters,
easystats/effectsize,
easystats/see
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -291,5 +291,3 @@ export(report_system)
export(report_table)
export(report_text)
import(datawizard)
import(effectsize)
import(insight)
46 changes: 34 additions & 12 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,62 @@
# report 0.3.6
# report 0.5.0

BREAKING CHANGES

* The following functions have now been removed from `report` and now live in [`datawizard`](https://easystats.github.io/datawizard/reference/index.html) package:
* The following functions have been removed from `{report}` and now live in
[`{datawizard}`](https://easystats.github.io/datawizard/reference/index.html)
package:

Data wrangling helpers:

- `data_addprefix()`

- `data_addsuffix()`

- `data_findcols()`

- `data_remove()`

- `data_rename()`

- `data_reorder()`

Text formatting helpers:

- `format_text()`
- `format_text()`

- `text_fullstop()`
- `text_lastchar()`

- `text_lastchar()`

- `text_concatenate()`

- `text_paste()`
- `text_remove()`

- `text_remove()`

- `text_wrap()`

MAJOR CHANGES

* Separated sex and gender into different searches/columns
* Sex is reported % female, % male, % other, % missing if any cases are missing
* Gender is reported % Women, % Men, % Non-Binary, % missing if any cases are missing
* Age reports % missing if any cases are missing
* Tests have been updated to reflect these changes
* Tests for missing cases have also been updated to test numbers for `NA`, and strings for `""` as `""` is not NA.
* Reporting participant's sex/gender information has improved (thanks to
@drfeinberg, #212)

- Separated sex and gender into different searches/columns

- Sex is reported % female, % male, % other, % missing if any cases are missing

- Gender is reported % Women, % Men, % Non-Binary, % missing if any cases are
missing

- Age reports % missing if any cases are missing.

# report 0.4.0

* Maintenance release.

# report 0.3.5

* Fixed issue with possibly wrong numbers in the `total` column from
* Fixed issue with possibly wrong numbers in the `total` column from
`report_sample()`, when grouping variable contained missing values.

# report 0.3.1
Expand All @@ -45,3 +66,4 @@ MAJOR CHANGES
# report 0.3.0

* Initial release of the package.

2 changes: 0 additions & 2 deletions R/report.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@
#' }
#'
#' @import datawizard
#' @import effectsize
#' @import insight
#'
#' @examples
#' library(report)
Expand Down
26 changes: 14 additions & 12 deletions R/report.lavaan.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,23 @@
#' @examples
#' library(report)
#' \donttest{
#' # Structural Equation Models (SEM)
#' if (require("lavaan")) {
#' structure <- " ind60 =~ x1 + x2 + x3
#' if (FALSE) {
#' # Structural Equation Models (SEM)
#' if (require("lavaan")) {
#' structure <- " ind60 =~ x1 + x2 + x3
#' dem60 =~ y1 + y2 + y3
#' dem60 ~ ind60 "
#' model <- lavaan::sem(structure, data = PoliticalDemocracy)
#' r <- report(model)
#' r
#' # summary(r)
#' # as.data.frame(r)
#' # summary(as.data.frame(r))
#' model <- lavaan::sem(structure, data = PoliticalDemocracy)
#' r <- report(model)
#' r
#' # summary(r)
#' # as.data.frame(r)
#' # summary(as.data.frame(r))
#'
#' # Specific reports
#' report_table(model)
#' report_performance(model)
#' # Specific reports
#' report_table(model)
#' report_performance(model)
#' }
#' }
#' }
#' @return An object of class [report()].
Expand Down
4 changes: 2 additions & 2 deletions R/report_performance.R
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ print.report_performance <- function(x, ...) {
if (length(perf_table[perf_table$Interpretation == "satisfactory", "Text"]) >= 1) {
text_satisfactory <- paste0(
"The ",
report::format_text(perf_table[perf_table$Interpretation == "satisfactory", "Text"]),
format_text(perf_table[perf_table$Interpretation == "satisfactory", "Text"]),
ifelse(length(perf_table[perf_table$Interpretation == "satisfactory", "Text"]) > 1, " suggest", " suggests"),
" a satisfactory fit."
)
Expand All @@ -276,7 +276,7 @@ print.report_performance <- function(x, ...) {
if (length(perf_table[perf_table$Interpretation == "poor", "Text"]) >= 1) {
text_poor <- paste0(
"The ",
report::format_text(perf_table[perf_table$Interpretation == "poor", "Text"]),
format_text(perf_table[perf_table$Interpretation == "poor", "Text"]),
ifelse(length(perf_table[perf_table$Interpretation == "poor", "Text"]) > 1, " suggest", " suggests"),
" a poor fit."
)
Expand Down
2 changes: 1 addition & 1 deletion man/report.data.frame.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 05bc6da

Please sign in to comment.