Skip to content

Commit 997b4f9

Browse files
authored
Merge pull request #257 from rmaia/R-4.0.0
Update minimum R version to 4.0.0
2 parents a3e3986 + aeb94f6 commit 997b4f9

File tree

14 files changed

+37
-32
lines changed

14 files changed

+37
-32
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ jobs:
4949
- uses: r-lib/actions/setup-r-dependencies@v2
5050
with:
5151
extra-packages:
52-
any::rcmdcheck,
53-
52+
any::rcmdcheck
5453
needs: check
5554

5655
- uses: r-lib/actions/check-r-package@v2

DESCRIPTION

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ License: GPL (>= 2)
3939
URL: http://pavo.colrverse.com, https://github.com/rmaia/pavo/
4040
BugReports: https://github.com/rmaia/pavo/issues
4141
Depends:
42-
R (>= 3.5.0)
42+
R (>= 4.0.0)
4343
Imports:
4444
cluster,
4545
future.apply,
@@ -49,8 +49,7 @@ Imports:
4949
farver,
5050
plot3D,
5151
progressr,
52-
sf,
53-
viridisLite
52+
sf
5453
Suggests:
5554
alphashape3d,
5655
imager,
@@ -68,5 +67,5 @@ Config/Needs/website:
6867
Encoding: UTF-8
6968
Language: en-GB
7069
Roxygen: list(markdown = TRUE)
71-
RoxygenNote: 7.2.3
70+
RoxygenNote: 7.3.1
7271
Config/testthat/edition: 3

NAMESPACE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
S3method(as.rimg,"magick-image")
44
S3method(as.rimg,cimg)
55
S3method(as.rimg,default)
6+
S3method(imager::as.cimg,rimg)
67
S3method(merge,rspec)
78
S3method(plot,colspace)
89
S3method(plot,rimg)
@@ -56,7 +57,6 @@ export(procimg)
5657
export(procspec)
5758
export(projplot)
5859
export(projpoints)
59-
export(rimg2cimg)
6060
export(rimg2magick)
6161
export(segplot)
6262
export(segspace)
@@ -102,7 +102,6 @@ importFrom(graphics,lines)
102102
importFrom(graphics,locator)
103103
importFrom(graphics,mtext)
104104
importFrom(graphics,par)
105-
importFrom(graphics,plot)
106105
importFrom(graphics,plot.default)
107106
importFrom(graphics,plot.new)
108107
importFrom(graphics,plot.window)

NEWS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
# pavo 2.10.0
22

3+
## NEW FEATURES AND SIGNIFICANT CHANGES
4+
5+
- the `rimg2cimg()` function has been removed in favour of a custom `as.cimg()` method.
6+
37
## MINOR FEATURES AND BUG FIXES
48

59
- `as.rspec()` now works out of the box with `tibble`, rather than requiring users to pass a standard data.frame.
610

11+
## INTERNAL CHANGES
12+
13+
- dependency on the `viridisLite` package has been removed in favour of recent base R functions
14+
715
# pavo 2.9.0
816

917
## NEW FEATURES AND SIGNIFICANT CHANGES

R/aggplot.R

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#'
2828
#' @export
2929
#'
30-
#' @importFrom graphics legend lines par plot.default polygon
30+
#' @importFrom graphics legend lines par polygon
3131
#' @importFrom grDevices adjustcolor
3232
#' @importFrom stats sd
3333
#'
@@ -137,9 +137,11 @@ aggplot <- function(rspecdata, by = NULL, FUN.center = mean, FUN.error = sd,
137137
lcol <- rep(lcol, ncol(cntplotspecs))
138138
}
139139

140-
col_list <- c(
141-
"#E41A1C", "#377EB8", "#4DAF4A", "#984EA3",
142-
"#FF7F00", "#FFFF33", "#A65628", "#F781BF"
140+
col_list <- grDevices::palette.colors(
141+
ncol(cntplotspecs),
142+
palette = "Okabe-Ito",
143+
alpha = 1,
144+
recycle = TRUE
143145
)
144146

145147
col_list <- rep_len(col_list, dim(cntplotspecs)[2])

R/as.rimg.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,15 +213,15 @@ NULL
213213

214214
#' @rdname img_conversion
215215
#'
216-
#' @export
217-
rimg2cimg <- function(image) {
216+
#' @exportS3Method imager::as.cimg
217+
as.cimg.rimg <- function(image) {
218218
## Check for imager
219219
if (!requireNamespace("imager", quietly = TRUE)) {
220220
stop("Package \"imager\" needed for conversion to cimg. Please install it.",
221221
call. = FALSE
222222
)
223223
}
224-
suppressWarnings(imager::as.cimg(image, cc = 3))
224+
NextMethod("as.cimg", image, cc = 3)
225225
}
226226
#' @rdname img_conversion
227227
#'

R/explorespec.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ explorespec <- function(rspecdata, by = NULL,
102102
arg$x <- wl
103103

104104
if (is.null(arg$col)) {
105-
col_list <- viridisLite::viridis(max(table(by)))
105+
col_list <- grDevices::hcl.colors(max(table(by)))
106106
} else {
107107
col_list <- arg$col
108108
}

R/jndplot.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#'
3939
#' @export
4040
#'
41-
#' @importFrom graphics plot.default par plot.default points arrows
41+
#' @importFrom graphics par points arrows
4242
#' @importFrom grDevices trans3d
4343
#'
4444
#' @keywords internal

R/pavo-package.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#' @keywords internal
22
"_PACKAGE"
33

4-
#' @importFrom graphics plot
4+
#' @importFrom graphics plot.default
55
# This functions has been moved to base since R 4.0.0
66
NULL
77

R/plot.rspec.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ plot.rspec <- function(x, select = NULL, type = c("overlay", "stack", "heatmap")
9999
}
100100

101101
if (is.null(arg$col)) {
102-
arg$col <- viridisLite::cividis(n)
102+
arg$col <- grDevices::hcl.colors(n, palette = "cividis")
103103
} else {
104104
jc <- colorRampPalette(arg$col)
105105
arg$col <- jc(n)

0 commit comments

Comments
 (0)