Skip to content

Commit

Permalink
changes for resubmission to CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
noellepablo committed Aug 16, 2024
1 parent 0c16888 commit 06f7dcc
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 21 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,5 @@ Config/testthat/edition: 3
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Language: en-US
6 changes: 2 additions & 4 deletions R/misc-manipulation.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
#' @param condition Logical condition to be evaluated
#' @examples
#' d <- tibble::as_tibble(mtcars)
#' d %>%
#' only_if(TRUE)(dplyr::filter)(mpg > 25)
#' d %>% only_if(TRUE)(dplyr::filter)(mpg > 25)
#'
#' d %>%
#' only_if(FALSE)(dplyr::filter)(mpg > 25)
#' d %>% only_if(FALSE)(dplyr::filter)(mpg > 25)
#' @author David Robinson, https://twitter.com/drob/status/785880369073500161
#' @export
#' @return None. Called for side effects.
Expand Down
6 changes: 3 additions & 3 deletions R/save-plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
#' @param embed_fonts Logical. Use Ghostscript to embed fonts in a PDF graphic?
#' @param ... Additional arguments passed to [ggplot2::ggsave()]
#' @examplesIf interactive()
#' ggplot(mtcars, aes(mpg, wt)) +
#' p <- ggplot(mtcars, aes(mpg, wt)) +
#' geom_point()
#'
#' ggsave("mtcars.pdf")
#' ggsave("mtcars.png")
#' ggsave2(p, "/mtcars.pdf", path = tempdir())
#' ggsave2(p, "/mtcars.png", path = tempdir())
#' @return None. Called for side effects.
#' @export
ggsave2 <- function(plot = ggplot2::last_plot(), filename, device = NULL,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<!-- badges: start -->

[![R-CMD-check](https://github.com/atlas-aai/ratlas/actions/workflows/check-standard.yaml/badge.svg)](https://github.com/atlas-aai/ratlas/actions/workflows/check-standard.yaml)
[![R-CMD-check](https://github.com/atlas-aai/ratlas/workflows/R-CMD-check/badge.svg)](https://github.com/atlas-aai/ratlas/actions)
[![Codecov test
coverage](https://codecov.io/gh/atlas-aai/ratlas/branch/main/graph/badge.svg)](https://app.codecov.io/gh/atlas-aai/ratlas?branch=main)

Expand Down
18 changes: 18 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
## Resubmission

This is a resubmission. The previous submission raised--

- Unexecutable code in man/only_if.Rd:
d %>%:

- Please ensure that your functions do not write by default or in your
examples/vignettes/tests in the user's home filespace (including the
package directory and getwd()) -> man/ggsave2.Rd

- Please always make sure to reset to user's options(), working directory
or par() after you changed it in examples and vignettes and demos.
-> inst/doc/plotting.R

These issues have now been fixed.


## Resubmission

This is a resubmission. The previous submission raised--
Check: Rd cross-references, Result: NOTE
Found the following Rd file(s) with Rd \link{} targets missing package
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ class: final-slide

# Connect With Us!

<i class="fas fa-globe" style="color:#165C7D;"></i> [ATLAS4Learning.org](https://atlas4learning.org)
<i class="fas fa-globe" style="color:#165C7D;"></i> [atlas.ku.edu](https://atlas.ku.edu)

<i class="fas fa-envelope" style="color:#165C7D;"></i> [[email protected]](mailto:[email protected])

<i class="fab fa-twitter" style="color:#165C7D;"></i> [@ATLAS4Learning](https://twitter.com/atlas4learning)
<i class="fab fa-twitter" style="color:#165C7D;"></i> [@ATLAS4Learning](https://x.com/atlas4learning)

<i class="fab fa-github" style="color:#165C7D;"></i> [@ATLAS-AAI](https://github.com/atlas-aai)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions man/ggsave2.Rd

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

6 changes: 2 additions & 4 deletions man/only_if.Rd

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

9 changes: 6 additions & 3 deletions vignettes/plotting.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,18 @@ img <- function(obj, nam) {
```

```{r cont-ex, echo = FALSE, fig.asp = 0.15, fig.cap = "(ref:cont-ex-cap)"}
par(mfrow=c(1, 1), mar=rep(1, 4))
oldpar <- par(mfrow=c(1, 1), mar=rep(1, 4))
img(rev(seq_gradient_pal(low = "#132B43", high = "#56B1F7",
space = "Lab")(seq(0, 1, length=n_col))), "")
par(oldpar)
```

The simulated color blindness for this scale is shown in Figure \@ref(fig:cont-cvd). Here, several types of color blindness result in large sections of the palette where it is difficult to differentiate values.

(ref:cont-cvd-cap) The default {ggplot2} color palette for continuous scales with different types of color blindness.

```{r cont-cvd, echo = FALSE, fig.asp = 0.5, fig.cap = "(ref:cont-cvd-cap)"}
par(mfrow=c(4, 1), mar=rep(1, 4))
oldpar <- par(mfrow=c(4, 1), mar=rep(1, 4))
img(dichromat(rev(seq_gradient_pal(low = "#132B43", high = "#56B1F7",
space = "Lab")(seq(0, 1, length=n_col))),
"deutan"), "Deutanomaly")
Expand All @@ -210,6 +211,7 @@ img(dichromat(rev(seq_gradient_pal(low = "#132B43", high = "#56B1F7",
img(desaturate(rev(seq_gradient_pal(low = "#132B43", high = "#56B1F7",
space = "Lab")(seq(0, 1, length=n_col)))),
"Desaturated")
par(oldpar)
```

### Using color blind safe palettes
Expand All @@ -230,12 +232,13 @@ ggplot(mtcars, aes(x = mpg, y = disp)) +
For continuous color scales, the viridis family of color palettes should be used. These palettes were created by [Stéfan van der Walt](https://github.com/stefanv) and [Nathaniel Smith](https://github.com/njsmith) and are shown in Figure \@ref(fig:show-viridis).

```{r show-viridis, echo = FALSE, fig.asp = 0.6, fig.cap = "The viridis color scales."}
par(mfrow=c(5, 1), mar=rep(1, 4))
oldpar <- par(mfrow=c(5, 1), mar=rep(1, 4))
img(rev(viridis(n_col)), "Viridis")
img(rev(magma(n_col)), "Magma")
img(rev(plasma(n_col)), "Plasma")
img(rev(inferno(n_col)), "Inferno")
img(rev(cividis(n_col)), "Cividis")
par(oldpar)
```

These color scales are perceptually uniform, perform well for a variety of colorblindness, and maintain the ability to discriminate across the perceptual spectrum when rendered or printed in gray scale. These color scales can be applied using `ggplot2::scale_color_viridis_c()`. Figure \@ref(fig:viridis-compare) shows and example of using the the viridis color palette. There is also a discrete option for the viridis color palette (`ggplot2::scale_color_viridis_d()`); however, the Okabe Ito palette is preferred for discrete scales.
Expand Down

0 comments on commit 06f7dcc

Please sign in to comment.