Skip to content

Commit

Permalink
Merge pull request #5 from pepijn-devries/work-in-progress
Browse files Browse the repository at this point in the history
Work in progress
  • Loading branch information
pepijn-devries authored Jul 25, 2024
2 parents 40cebc1 + 9ce0a14 commit c13679a
Show file tree
Hide file tree
Showing 14 changed files with 427 additions and 277 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 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: R-CMD-check

permissions: read-all

jobs:
R-CMD-check:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
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::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Package: ggfields
Title: Add Vector Field Layers to Ggplots
Version: 0.0.6
Date: 2024-02-26
Version: 0.0.6.0001
Authors@R: c(person("Pepijn", "de Vries", role = c("aut", "cre"),
email = "[email protected]",
comment = c(ORCID = "0000-0002-7961-6646")))
Expand Down
10 changes: 8 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
ggfields v0.0.6 (Release date: 2024-02-26)
ggfields v0.0.6.0001
-------------

* Fixed test
* Added test coverage workflow

ggfields v0.0.6
-------------

* Some tweaks to `pkgdown` website
* Fixes to pass CRAN checks

ggfields v0.0.3 (Release date: 2024-02-01)
ggfields v0.0.3
-------------

* Initial release
Expand Down
8 changes: 4 additions & 4 deletions R/scale.r
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#' @export
scale_radius_continuous <- function(..., range = c(1e-8, 1)) {
ggplot2::continuous_scale(
"radius", "radius_c",
scales::rescale_pal(range = range),
"radius",
palette = scales::rescale_pal(range = range),
rescaler = function(x, to = range, from = c(0, max(x, na.rm = TRUE))) {
x <- as.numeric(x)
if (any(stats::na.omit(x) < 0)) rlang::abort(c(
Expand All @@ -50,13 +50,13 @@ scale_radius_continuous <- function(..., range = c(1e-8, 1)) {
#' @rdname scale
#' @export
scale_radius_binned <- function(..., range = c(1e-8, 1)) {
ggplot2::binned_scale("radius", "radius_b", scales::rescale_pal(range), ...)
ggplot2::binned_scale("radius", palette = scales::rescale_pal(range), ...)
}

#' @name scale_radius_discrete
#' @rdname scale
#' @export
scale_radius_discrete <- function(..., range = c(1e-8, 1)) {
ggplot2::discrete_scale("radius", "radius_d", function(n)
ggplot2::discrete_scale("radius", palette = function(n)
seq(range[[1]], range[[2]], length.out = n), ...)
}
8 changes: 8 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ knitr::opts_chunk$set(

## Overview

<!-- badges: start -->
[![R-CMD-check](https://github.com/pepijn-devries/ggfields/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/pepijn-devries/ggfields/actions/workflows/R-CMD-check.yaml)
![cranlogs](https://cranlogs.r-pkg.org/badges/ggfields)
[![version](https://www.r-pkg.org/badges/version/ggfields)](https://CRAN.R-project.org/package=ggfields)
[![cran checks](https://badges.cranchecks.info/worst/ggfields.svg)](https://cran.r-project.org/web/checks/check_results_ggfields.html)
[![csquares status badge](https://pepijn-devries.r-universe.dev/badges/ggfields)](https://pepijn-devries.r-universe.dev/ggfields)
<!-- badges: end -->

<img src="man/figures/logo.png" align="right" alt = "logo" class = "pkgdown-hide" />

Add vector field layers to your `ggplot2::ggplot()`. Although it has similarities
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@

## Overview

<!-- badges: start -->

[![R-CMD-check](https://github.com/pepijn-devries/ggfields/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/pepijn-devries/ggfields/actions/workflows/R-CMD-check.yaml)
![cranlogs](https://cranlogs.r-pkg.org/badges/ggfields)
[![version](https://www.r-pkg.org/badges/version/ggfields)](https://CRAN.R-project.org/package=ggfields)
[![cran
checks](https://badges.cranchecks.info/worst/ggfields.svg)](https://cran.r-project.org/web/checks/check_results_ggfields.html)
[![csquares status
badge](https://pepijn-devries.r-universe.dev/badges/ggfields)](https://pepijn-devries.r-universe.dev/ggfields)
<!-- badges: end -->

<img src="man/figures/logo.png" align="right" alt = "logo" class = "pkgdown-hide" />

Add vector field layers to your `ggplot2::ggplot()`. Although it has
Expand Down Expand Up @@ -36,6 +47,7 @@ The example below shows how seawater current data can be added to a map:

``` r
library(ggplot2)
#> Warning: package 'ggplot2' was built under R version 4.3.3
library(ggfields)
library(ggspatial) ## For annotating with Open Street Map
```
Expand Down
47 changes: 39 additions & 8 deletions man/annotation_fields.Rd

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

2 changes: 1 addition & 1 deletion man/figures/README-dataframe-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
458 changes: 229 additions & 229 deletions man/figures/README-map-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 39 additions & 8 deletions man/geom_fields.Rd

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

47 changes: 39 additions & 8 deletions man/stat_fields.Rd

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

22 changes: 9 additions & 13 deletions tests/testthat/_snaps/plots/ggfields-north.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions tests/testthat/test_dev.r
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
test_that("Source code should not have things on TODO list", {
expect_false({
skip_if(length(unclass(packageVersion("ggfields"))[[1]]) > 3,
"Skipping during development")
files_to_check <-
list.files(system.file(package = "ggfields"),
pattern = "[.]r$|NEWS|DESCRIPTION|README", recursive = TRUE, full.names = TRUE)
Expand Down
Loading

0 comments on commit c13679a

Please sign in to comment.