Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prep for CRAN release #80

Merged
merged 10 commits into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ myignore
^tests/README\.md$
^\.vscode$
^CRAN-SUBMISSION$
^revdep$
95 changes: 95 additions & 0 deletions .github/workflows/rhub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# 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'
name:
description: 'Run name. You can leave this empty now.'
type: string
id:
description: 'Unique ID. You can leave this empty now.'
type: string

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: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
ggeasy.Rproj
inst/doc
.vscode
revdep
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

3 changes: 3 additions & 0 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version: 0.1.5
Date: 2024-11-03 05:23:01 UTC
SHA: 59497fe0c4b9efc50ea942655af763ab6b8f1877
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ggeasy
Title: Easy Access to 'ggplot2' Commands
Version: 0.1.4
Version: 0.1.5
Authors@R: c(
person("Jonathan", "Carroll", email = "rpkg@jcarroll.com.au", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-1404-5264")),
person("Alicia", "Schep", email = "aschep@gmail.com", role = c("aut"), comment = c(ORCID = "0000-0002-3915-0618")),
Expand All @@ -14,10 +14,11 @@ Description: Provides a series of aliases to commonly used but difficult
to remember 'ggplot2' sequences.
License: GPL (>=2)
Encoding: UTF-8
Depends: R (>= 3.5.0)
Imports:
ggplot2,
rlang
RoxygenNote: 7.1.1
RoxygenNote: 7.3.2
Suggests:
knitr,
rmarkdown,
Expand Down
8 changes: 8 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ export(easy_adjust_legend)
export(easy_all_text_color)
export(easy_all_text_colour)
export(easy_all_text_size)
export(easy_caption_size)
export(easy_center_title)
export(easy_change_legend)
export(easy_change_text)
export(easy_labs)
export(easy_legend_at)
export(easy_legend_size)
export(easy_legend_title_size)
export(easy_move_legend)
export(easy_plot_caption_size)
export(easy_plot_legend_size)
Expand All @@ -31,9 +34,14 @@ export(easy_rotate_labels)
export(easy_rotate_legend)
export(easy_rotate_x_labels)
export(easy_rotate_y_labels)
export(easy_subtitle_size)
export(easy_text_color)
export(easy_text_colour)
export(easy_text_size)
export(easy_title_bold)
export(easy_title_plain)
export(easy_title_regular)
export(easy_title_size)
export(easy_x_axis_labels_size)
export(easy_x_axis_title_size)
export(easy_y_axis_labels_size)
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# ggeasy 0.1.5

* Restore compatibility with ggplot2's get_labs()
* Added easy_*_size() functions which do not have 'plot' in the name (#77, @davidhodge931)
* Added easy_title_bold(), easy_title_plain(), and easy_title_regular() (#71, @davidhodge931)
* Minor fixes for CRAN

# ggeasy 0.1.4

* Added easy_remove_gridlines() (#45, @thomas-neitmann)
Expand Down
4 changes: 2 additions & 2 deletions R/ggeasy-package.r
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
#' Helper functions for making using ggplot2 easier.
#'
#' @name ggeasy
#' @keywords internal
#' @import ggplot2
#' @docType package
NULL
"_PACKAGE"
4 changes: 2 additions & 2 deletions R/gridlines.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#'
#' @examples
#' library(ggplot2)
#' p <- ggplot(mtcars, aes(hp, mpg))
#' + geom_point()
#' p <- ggplot(mtcars, aes(hp, mpg)) +
#' geom_point()
#'
#' # remove all grid lines at once
#' p + easy_remove_gridlines()
Expand Down
10 changes: 9 additions & 1 deletion R/labs2.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ ggplot_add.easy_labs <- function(object, plot, object_name) {

#' @importFrom utils modifyList
easy_update_labs <- function(p, man_labs) {
p_labs <- p$labels
p_labs <- get_labs(p)
p_labs <- Filter(\(x) !is.null(x) && x != "", p_labs)
d <- p$data
d_labs <- lapply(d, function(x) attr(x, "label"))
has_labs <- sapply(d_labs, function(x) !is.null(x))
Expand Down Expand Up @@ -70,3 +71,10 @@ easy_update_labs <- function(p, man_labs) {
ggplot2::update_labels(p, p_labs)

}

#' @keywords internal
get_labs <- if ("get_labs" %in% getNamespaceExports("ggplot2")) {
ggplot2::get_labs
} else {
function(plot) plot$labels
}
36 changes: 36 additions & 0 deletions R/text.R
Original file line number Diff line number Diff line change
Expand Up @@ -186,36 +186,72 @@ easy_plot_title_size <- function(size = NULL, teach = FALSE) {
easy_change_text(which = "plot.title", what = "size", to = size, teach = teach)
}

#' @export
#' @rdname easy_change_text
easy_title_size <- easy_plot_title_size

#' @export
#' @rdname easy_change_text
easy_plot_subtitle_size <- function(size = NULL, teach = FALSE) {
if (is.null(size)) return(easy_change_text(which = "plot.subtitle", what = NULL, teach = teach))
easy_change_text(which = "plot.subtitle", what = "size", to = size, teach = teach)
}

#' @export
#' @rdname easy_change_text
easy_subtitle_size <- easy_plot_subtitle_size

#' @export
#' @rdname easy_change_text
easy_plot_caption_size <- function(size = NULL, teach = FALSE) {
if (is.null(size)) return(easy_change_text(which = "plot.caption", what = NULL, teach = teach))
easy_change_text(which = "plot.caption", what = "size", to = size, teach = teach)
}

#' @export
#' @rdname easy_change_text
easy_caption_size <- easy_plot_caption_size

#' @export
#' @rdname easy_change_text
easy_plot_legend_size <- function(size = NULL, teach = FALSE) {
if (is.null(size)) return(easy_change_text(which = "legend.text", what = NULL, teach = teach))
easy_change_text(which = "legend.text", what = "size", to = size, teach = teach)
}

#' @export
#' @rdname easy_change_text
easy_legend_title_size <- easy_plot_legend_size

#' @export
#' @rdname easy_change_text
easy_plot_legend_title_size <- function(size = NULL, teach = FALSE) {
if (is.null(size)) return(easy_change_text(which = "legend.title", what = NULL, teach = teach))
easy_change_text(which = "legend.title", what = "size", to = size, teach = teach)
}

#' @export
#' @rdname easy_change_text
easy_legend_size <- easy_plot_legend_title_size

#' @export
#' @rdname easy_change_text
easy_center_title <- function(teach = FALSE) {
easy_change_text(which = "plot.title", what = "hjust", to = .5, teach = teach)
}

#' @export
#' @rdname easy_change_text
easy_title_bold <- function() {
easy_change_text("plot.title", "face", "bold")
}

#' @export
#' @rdname easy_change_text
easy_title_regular <- function() {
easy_change_text("plot.title", "face", "plain")
}

#' @export
#' @rdname easy_change_text
easy_title_plain <- easy_title_regular
3 changes: 1 addition & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ knitr::opts_chunk$set(
<!-- http://www.clker.com/clipart-2-puzzle-pieces-connected.html -->

[![Covrpage Summary](https://img.shields.io/badge/covrpage-Last_Build_2023_03_11-brightgreen.svg)](https://github.com/jonocarroll/ggeasy/blob/master/tests/README.md)
[![Travis build status](https://travis-ci.org/jonocarroll/ggeasy.svg?branch=master)](https://travis-ci.org/jonocarroll/ggeasy)
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/jonocarroll/ggeasy?branch=master&svg=true)](https://ci.appveyor.com/project/jonocarroll/ggeasy)
[![R-CMD-check](https://github.com/jonocarroll/ggeasy/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jonocarroll/ggeasy/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/jonocarroll/ggeasy/branch/master/graph/badge.svg)](https://app.codecov.io/gh/jonocarroll/ggeasy?branch=master)
Expand Down Expand Up @@ -56,7 +55,7 @@ See the [`pkgdown` site](https://jonocarroll.github.io/ggeasy/).

[![Watch the video](https://img.youtube.com/vi/iAH1GJoBZmI/maxresdefault.jpg)](https://youtu.be/iAH1GJoBZmI)

[Sharon Machlis](https://www.infoworld.com/author/Sharon-Machlis/) has a great [article](https://www.infoworld.com/article/3533453/easier-ggplot-with-the-ggeasy-r-package.html) detailing using the package, as well as a video
[Sharon Machlis](https://www.infoworld.com/profile/sharon-machlis/) has a great [article](https://www.infoworld.com/article/2256726/easier-ggplot-with-the-ggeasy-r-package.html) detailing using the package, as well as a video

[![Watch the video](https://img.youtube.com/vi/-2ZvQQ583pI/maxresdefault.jpg)](https://www.youtube.com/watch?v=-2ZvQQ583pI)

Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

[![Covrpage
Summary](https://img.shields.io/badge/covrpage-Last_Build_2023_03_11-brightgreen.svg)](https://github.com/jonocarroll/ggeasy/blob/master/tests/README.md)
[![Travis build
status](https://travis-ci.org/jonocarroll/ggeasy.svg?branch=master)](https://travis-ci.org/jonocarroll/ggeasy)
[![AppVeyor build
status](https://ci.appveyor.com/api/projects/status/github/jonocarroll/ggeasy?branch=master&svg=true)](https://ci.appveyor.com/project/jonocarroll/ggeasy)
[![R-CMD-check](https://github.com/jonocarroll/ggeasy/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jonocarroll/ggeasy/actions/workflows/R-CMD-check.yaml)
Expand Down Expand Up @@ -54,9 +52,9 @@ walkthrough using `ggeasy` which covers some of the major features:
[![Watch the
video](https://img.youtube.com/vi/iAH1GJoBZmI/maxresdefault.jpg)](https://youtu.be/iAH1GJoBZmI)

[Sharon Machlis](https://www.infoworld.com/author/Sharon-Machlis/) has a
great
[article](https://www.infoworld.com/article/3533453/easier-ggplot-with-the-ggeasy-r-package.html)
[Sharon Machlis](https://www.infoworld.com/profile/sharon-machlis/) has
a great
[article](https://www.infoworld.com/article/2256726/easier-ggplot-with-the-ggeasy-r-package.html)
detailing using the package, as well as a video

[![Watch the
Expand All @@ -66,6 +64,11 @@ video](https://img.youtube.com/vi/-2ZvQQ583pI/maxresdefault.jpg)](https://www.yo

``` r
library(ggplot2)
#>
#> Attaching package: 'ggplot2'
#> The following object is masked from 'package:base':
#>
#> is.element
library(ggeasy)

# rotate x axis labels
Expand Down
14 changes: 8 additions & 6 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
## Updated package

Fixed WARN/NOTEs and added some new features.

One issue on winbuilder due to svglite which seems to be due to an
out of date installation. Same as
https://stackoverflow.com/questions/72136553/tests-with-expect-doppelganger-fail-after-upgrade-to-r-4-2-0
Fixed _PACKAGE documentation as requested
Updated to align with ggplot2 updates
Minor alias additions

## R CMD check results

Checked with rhubv2 linux, macos, macos-arm64, and windows.
Checked with winbuilder devel, release, and oldrelease.

0 errors | 0 warnings | 0 notes

## Reverse dependencies

Confirmed no new issues with reverse imports.
Current revdeps: autostats, FPDclustering, SqueakR
revdepcheck::revdep_check() reports no new problems.
Loading
Loading