Skip to content

Commit

Permalink
Merge pull request #747 from olivroy/upkeep
Browse files Browse the repository at this point in the history
Avoid testthat deprecated features + upkeep
  • Loading branch information
michaelquinn32 authored Jan 23, 2025
2 parents 7a1bacc + 616b8db commit 7d6bd61
Show file tree
Hide file tree
Showing 68 changed files with 1,057 additions and 1,137 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [develop, main]
branches: [main, develop]
pull_request:
branches: [develop, main]

name: R-CMD-check
name: R-CMD-check.yaml

permissions: read-all

jobs:
R-CMD-check:
Expand All @@ -18,7 +19,7 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
Expand All @@ -29,7 +30,7 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

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

Expand All @@ -47,3 +48,4 @@ jobs:
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
78 changes: 0 additions & 78 deletions .github/workflows/manual-standard-check.yaml

This file was deleted.

47 changes: 0 additions & 47 deletions .github/workflows/pkgdown.yaml

This file was deleted.

75 changes: 41 additions & 34 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,54 +1,61 @@
# 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
branches: [main, master]
pull_request:
branches:
- main

name: test-coverage
name: test-coverage.yaml

permissions: read-all

jobs:
test-coverage:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
env:
RSPM: https://packagemanager.rstudio.com/cran/__linux__/bionic/latest
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
id: install-r

- name: Install pak and query dependencies
run: |
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
shell: Rscript {0}
with:
use-public-rspm: true

- name: Restore R package cache
uses: actions/cache@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: |
${{ env.R_LIBS_USER }}/*
!${{ env.R_LIBS_USER }}/pak
key: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
restore-keys: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1-

- name: Install system dependencies
if: runner.os == 'Linux'
extra-packages: any::covr, any::xml2
needs: coverage

- name: Test coverage
run: |
pak::local_system_requirements(execute = TRUE)
pak::pkg_system_requirements("covr", execute = TRUE)
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
covr::to_cobertura(cov)
shell: Rscript {0}

- name: Install dependencies
- uses: codecov/codecov-action@v4
with:
# Fail if error if not on PR, or if on PR and token is given
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Show testthat output
if: always()
run: |
pak::local_install_dev_deps(upgrade = TRUE)
pak::pkg_install("covr")
shell: Rscript {0}
## --------------------------------------------------------------------
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Test coverage
run: covr::codecov()
shell: Rscript {0}
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
11 changes: 5 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Depends:
R (>= 3.1.2)
Imports:
cli,
dplyr (>= 0.8.0),
dplyr (>= 1.0.0),
knitr (>= 1.2),
magrittr (>= 1.5),
pillar (>= 1.6.4),
Expand All @@ -133,23 +133,21 @@ Imports:
tibble (>= 2.0.0),
tidyr (>= 1.0),
tidyselect (>= 1.0.0),
vctrs
vctrs (>= 0.5.0)
Suggests:
covr,
crayon,
data.table,
dtplyr,
extrafont,
haven,
lubridate,
rmarkdown,
testthat (>= 2.0.0),
testthat (>= 3.0.0),
withr
VignetteBuilder:
knitr
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
Collate:
'deprecated.R'
'dplyr.R'
Expand All @@ -165,3 +163,4 @@ Collate:
'summary.R'
'utils.R'
'vctrs.R'
Config/testthat/edition: 3
17 changes: 8 additions & 9 deletions R/reshape.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,9 @@ reconcile_skimmers <- function(data, groups, base) {
extra_cols <- dplyr::setdiff(all_columns, with_base_columns)
if (length(extra_cols) > 0) {
grouped <- dplyr::group_by(data, .data$skim_type)
complete_by_type <- dplyr::summarize_at(
complete_by_type <- dplyr::summarise(
grouped,
extra_cols,
~ !all(is.na(.x))
dplyr::across(tidyselect::all_of(extra_cols), ~ !all(is.na(.x)))
)
complete_cols <- purrr::pmap(
complete_by_type,
Expand Down Expand Up @@ -242,12 +241,12 @@ to_long.default <- function(.data, ..., skim_fun = skim) {
#' @describeIn to_long Transform a skim_df to a long data frame.
#' @export
to_long.skim_df <- function(.data, ..., skim_fun = skim) {
tidyr::gather(
.data <- dplyr::mutate(.data, dplyr::across(dplyr::everything(), as.character))
tidyr::pivot_longer(
.data,
key = "stat",
value = "formatted",
na.rm = TRUE,
-"skim_type",
-"skim_variable"
cols = c(-"skim_type", -"skim_variable"),
names_to = "stat",
values_to = "formatted",
values_drop_na = TRUE
)
}
2 changes: 1 addition & 1 deletion R/skim.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
#' iris %>%
#' skim() %>%
#' dplyr::select(numeric.mean) %>%
#' dplyr::top_n(5)
#' dplyr::slice_head(n = 5)
#'
#' # Which of my columns have missing values? Use the base skimmer n_missing.
#' iris %>%
Expand Down
2 changes: 1 addition & 1 deletion R/skim_print.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#'
#' @inheritParams tibble::print.tbl
#' @seealso [tibble::trunc_mat()] For a list of global options for customizing
#' print formatting. [crayon::has_color()] for the variety of issues that
#' print formatting. [cli::num_ansi_colors()] for the variety of issues that
#' affect tibble's color support.
#' @param include_summary Whether a summary of the data frame should be printed
#' @param summary_rule_width Width of Data Summary cli rule, defaults to 40.
Expand Down
8 changes: 2 additions & 6 deletions R/skimr-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,12 @@
#' provides an API for customization. Users can change both the functions
#' dispatched and the way the results are formatted.
#'
#' @importFrom rlang .data
#' @name skimr-package
#' @aliases skimr
#' @docType package
NULL
"_PACKAGE"


# Imports -----------------------------------------------------------------

#' @importFrom rlang %||%
#' @importFrom rlang %||% .data

#' @importFrom magrittr %>%
#' @export
Expand Down
9 changes: 5 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,22 @@ align="right" height="139" /></a>

```{r set-options, echo=FALSE, message=FALSE}
library(skimr)
options(tibble.width = Inf)
options(pillar.width = Inf)
options(width = 100)
```

<!-- badges: start -->
[![Project Status: Active – The project has reached a stable, usable
state and is being actively
developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/)
[![R build
status](https://github.com/ropensci/skimr/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci/skimr/actions?workflow=R-CMD-check)
[![codecov](https://codecov.io/gh/ropensci/skimr/branch/main/graph/badge.svg)](https://app.codecov.io/gh/ropensci/skimr)
[![R-CMD-check](https://github.com/ropensci/skimr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ropensci/skimr/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/ropensci/skimr/graph/badge.svg)](https://app.codecov.io/gh/ropensci/skimr)
[![This is an ROpenSci Peer reviewed
package](https://badges.ropensci.org/175_status.svg)](https://github.com/ropensci/software-review/issues/175)
[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/skimr)](https://cran.r-project.org/package=skimr)
[![cran
checks](https://badges.cranchecks.info/worst/skimr.svg)](https://badges.cranchecks.info/worst/skimr.svg)
<!-- badges: end -->


`skimr` provides a frictionless approach to summary statistics which conforms
Expand Down
Loading

0 comments on commit 7d6bd61

Please sign in to comment.