Skip to content

Commit

Permalink
ggplot2 depreciation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
adwolfer committed Dec 11, 2022
1 parent 6c1bf60 commit 8929d1b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/plotHistogram.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ plotHistogram <- function(var, varName = "Variable", density = TRUE, ...) {
# with density
if (density) {
p_hist <- p_hist +
ggplot2::geom_histogram(ggplot2::aes(y = ..density..),
ggplot2::geom_histogram(ggplot2::aes(y=ggplot2::after_stat(density)),
colour = "black", fill = "white", ...) +
ggplot2::geom_density(alpha = 0.1, fill = "blue")
# without density
Expand Down
2 changes: 1 addition & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
utils::globalVariables(
# data.frame column names used in ggplot (cannot use aes_string due to
# transformations to the column in aes())
c("x","y","colr","..density..","rt","int","specID", "rt_dev_sec",
c("x","y","colr","rt","int","specID", "rt_dev_sec",
"isReference", "predictedRtDrift")
)
invisible()
Expand Down
3 changes: 2 additions & 1 deletion inst/NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Changes in version 1.13.1 (2022-12-11)
- Bugfix: plotHistogram changing warning message
- Bugfix: peakPantheR_plotPeakwidth issue due to ggplot2 behaviour changes for
date axis
date axis
- Depreciation warning from ggplot2 `..density..` to `after_stat()`

0 comments on commit 8929d1b

Please sign in to comment.