Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
Upkeep 2024 (#492)
Browse files Browse the repository at this point in the history
* Redocument
* Add missing S3 methods
* use_tidy_description()
* use_tidy_github_actions()
* Make Hadley maintainer; update company name
* Doc fixes
* Drop badges
  • Loading branch information
hadley authored Feb 2, 2024
1 parent 642a6ab commit d3a6139
Show file tree
Hide file tree
Showing 14 changed files with 226 additions and 112 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ bench
^cran-comments\.md$
^\.github$
^CRAN-RELEASE$
^codecov\.yml$
102 changes: 30 additions & 72 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# NOTE: This workflow is overkill for most R packages
# check-standard.yaml is likely a better choice
# usethis::use_github_action("check-standard") will install it.
# 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
#
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
# NOTE: This workflow is overkill for most R packages and
# check-standard.yaml is likely a better choice.
# usethis::use_github_action("check-standard") will install it.
on:
push:
branches:
- master
branches: [main, master]
pull_request:
branches:
- master
branches: [main, master]

name: R-CMD-check

Expand All @@ -24,81 +22,41 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: macos-latest, r: 'release'}

- {os: windows-latest, r: 'release'}
# Use 3.6 to trigger usage of RTools35
- {os: windows-latest, r: '3.6'}
- {os: ubuntu-16.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest", http-user-agent: "R/4.0.0 (ubuntu-16.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
- {os: ubuntu-16.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.3', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
# use 4.1 to check with rtools40's older compiler
- {os: windows-latest, r: '4.1'}

- {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-2'}
- {os: ubuntu-latest, r: 'oldrel-3'}
- {os: ubuntu-latest, r: 'oldrel-4'}

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: actions/checkout@v4

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

- uses: r-lib/actions/setup-r@master
- 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@v2
- 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'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "16.04"))')
- 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}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_: 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
extra-packages: any::rcmdcheck
needs: check

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
- uses: r-lib/actions/check-r-package@v2
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
upload-snapshots: true
79 changes: 79 additions & 0 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# 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:
issue_comment:
types: [created]

name: Commands

jobs:
document:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }}
name: document
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::roxygen2
needs: pr-document

- name: Document
run: roxygen2::roxygenise()
shell: Rscript {0}

- name: commit
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add man/\* NAMESPACE
git commit -m 'Document'
- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

style:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/style') }}
name: style
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

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

- name: Install dependencies
run: install.packages("styler")
shell: Rscript {0}

- name: Style
run: styler::style_pkg()
shell: Rscript {0}

- name: commit
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add \*.R
git commit -m 'Style'
- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
50 changes: 50 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
63 changes: 32 additions & 31 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,49 +1,50 @@
Package: ggvis
Title: Interactive Grammar of Graphics
Description: An implementation of an interactive grammar of graphics, taking the
best parts of 'ggplot2', combining them with the reactive framework of
'shiny' and drawing web graphics using 'vega'.
Version: 0.4.8
Authors@R: c(
person("Winston", "Chang", role = c("aut", "cre"), email = "[email protected]"),
person("Hadley", "Wickham", role = "aut", email = "[email protected]"),
person(family = "RStudio", role = "cph"),
person(family = "jQuery Foundation", role = "cph",
comment = "jQuery library and jQuery UI library"),
person(family = "jQuery contributors", role = c("ctb", "cph"),
comment = "jQuery library; authors listed in inst/www/lib/jquery/AUTHORS.txt"),
person(family = "jQuery UI contributors", role = c("ctb", "cph"),
comment = "jQuery UI library; authors listed in inst/www/lib/jquery-ui/AUTHORS.txt"),
person("Mike", "Bostock", role = c("ctb", "cph"), comment = "D3 library"),
person(family = "D3 contributors", role = "ctb",
comment = "D3 library; authors listed at https://github.com/d3/d3/graphs/contributors"),
person(family = "Trifacta Inc.", role = "cph",
comment = "Vega library"),
person(family = "Vega contributors", role = "ctb",
comment = "Vega library; authors listed at https://github.com/trifacta/vega/graphs/contributors"),
person("Hadley", "Wickham", , "[email protected]", role = c("aut", "cre")),
person("Winston", "Chang", , "[email protected]", role = "aut"),
person(, "Posit", role = "cph"),
person(, "jQuery Foundation", role = "cph",
comment = "jQuery library and jQuery UI library"),
person(, "jQuery contributors", role = c("ctb", "cph"),
comment = "jQuery library; authors listed in inst/www/lib/jquery/AUTHORS.txt"),
person(, "jQuery UI contributors", role = c("ctb", "cph"),
comment = "jQuery UI library; authors listed in inst/www/lib/jquery-ui/AUTHORS.txt"),
person("Mike", "Bostock", role = c("ctb", "cph"),
comment = "D3 library"),
person(, "D3 contributors", role = "ctb",
comment = "D3 library; authors listed at https://github.com/d3/d3/graphs/contributors"),
person(, "Trifacta Inc.", role = "cph",
comment = "Vega library"),
person(, "Vega contributors", role = "ctb",
comment = "Vega library; authors listed at https://github.com/trifacta/vega/graphs/contributors"),
person("Sebastián", "Décima", role = c("ctb", "cph"),
comment = "javascript-detect-element-resize library")
)
comment = "javascript-detect-element-resize library")
)
Description: An implementation of an interactive grammar of graphics,
taking the best parts of 'ggplot2', combining them with the reactive
framework of 'shiny' and drawing web graphics using 'vega'.
License: GPL-2 | file LICENSE
URL: https://ggvis.rstudio.com/
Depends:
R (>= 3.0)
Imports:
assertthat,
dplyr (>= 0.5.0),
htmltools (>= 0.2.4),
jsonlite (>= 0.9.11),
shiny (>= 0.11.1),
magrittr,
dplyr (>= 0.5.0),
methods,
rlang,
htmltools (>= 0.2.4),
methods
shiny (>= 0.11.1)
Suggests:
knitr (>= 1.6),
lubridate,
MASS,
mgcv,
lubridate,
testthat (>= 0.8.1),
knitr (>= 1.6),
rmarkdown
rmarkdown,
testthat (>= 0.8.1)
Encoding: UTF-8
License: GPL-2 | file LICENSE
LazyData: true
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ S3method(compute_bin,grouped_df)
S3method(compute_boxplot,data.frame)
S3method(compute_boxplot,ggvis)
S3method(compute_boxplot,grouped_df)
S3method(compute_boxplot_outliers,data.frame)
S3method(compute_boxplot_outliers,ggvis)
S3method(compute_boxplot_outliers,grouped_df)
S3method(compute_count,data.frame)
S3method(compute_count,ggvis)
S3method(compute_count,grouped_df)
Expand All @@ -68,6 +71,7 @@ S3method(data_range,factor)
S3method(distinct,ggvis)
S3method(distinct,reactive)
S3method(empty,default)
S3method(eval_vector,data.frame)
S3method(explain,ggvis)
S3method(extract_reactives,default)
S3method(extract_reactives,ggvis_props)
Expand Down
1 change: 1 addition & 0 deletions R/compute_bin.R
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ bin_vector <- function(x, weight = NULL, ...) {
}

#' @export
#' @rdname bin_vector
bin_vector.numeric <- function(x, weight = NULL, ..., width = 1,
origin = 0, closed = c("right", "left"),
pad = FALSE) {
Expand Down
3 changes: 3 additions & 0 deletions R/compute_boxplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,17 @@ compute_boxplot.ggvis <- function(x, var = NULL, coef = 1.5) {

compute_boxplot_outliers <- function(x) UseMethod("compute_boxplot_outliers")

#' @export
compute_boxplot_outliers.grouped_df <- function(x) {
dplyr::do(x, compute_boxplot_outliers(.))
}

#' @export
compute_boxplot_outliers.data.frame <- function(x) {
data.frame(value_ = unlist(x$outliers_))
}

#' @export
compute_boxplot_outliers.ggvis <- function(x) {
register_computation(x, args = NULL, "boxplot_outliers", function(data, args) {
output <- compute_boxplot_outliers(data)
Expand Down
2 changes: 0 additions & 2 deletions R/ggvis.R
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ add_mark <- function(vis, type = NULL, props = NULL, data = NULL,
#'
#' @param vis Visualisation to modify.
#' @param scale Scale object
#' @param domain Either a vector with static values for the domain, or
#' a reactive that returns a such a vector.
#' @param data_domain Should the domain be controlled by a data set which is
#' added to the spec? Should only be set to FALSE in special cases.
#' @keywords internal
Expand Down
Loading

0 comments on commit d3a6139

Please sign in to comment.