Skip to content

Commit 1499635

Browse files
committed
fix deprecation warning about using as.character() on quosures
1 parent 0f68566 commit 1499635

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

R/mcmc-intervals.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ mcmc_intervals <- function(x,
165165

166166
data <- mcmc_intervals_data(x, pars, regex_pars, transformations,
167167
prob = prob, prob_outer = prob_outer,
168-
point_est = point_est, rhat = rhat)
168+
point_est = point_est, rhat = rhat)
169169

170170
color_by_rhat <- rlang::has_name(data, "rhat_rating")
171171
no_point_est <- all(data$point_est == "none")

tests/testthat/test-mcmc-intervals.R

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,10 @@ test_that("mcmc_intervals/areas with rhat", {
8585
expect_error(expect_warning(mcmc_intervals(arr, rhat = rbad)))
8686

8787
expect_gg(g <- mcmc_intervals(arr, rhat = r))
88+
8889
if (utils::packageVersion("ggplot2") >= "3.0.0") {
8990
rhat_map <- g$layers[[3]][["mapping"]]
90-
expect_identical(as.character(rhat_map[["colour"]]), c("~", "rhat_rating"))
91+
expect_identical(rlang::as_name(rhat_map[["colour"]]), "rhat_rating")
9192
}
9293

9394
# areas with rhat.
@@ -98,18 +99,18 @@ test_that("mcmc_intervals/areas with rhat", {
9899
expect_gg(g2 <- mcmc_areas(arr, rhat = r))
99100
if (utils::packageVersion("ggplot2") >= "3.0.0") {
100101
rhat_map2 <- g2$layers[[2]][["mapping"]]
101-
expect_identical(as.character(rhat_map2$fill), c("~", "rhat_rating"))
102-
expect_identical(as.character(rhat_map2$colour), c("~", "rhat_rating"))
102+
expect_identical(rlang::as_name(rhat_map2$fill), "rhat_rating")
103+
expect_identical(rlang::as_name(rhat_map2$colour), "rhat_rating")
104+
103105
# layer 3 is point estimate. manually colored. [skip]
104106

105107
# layer 4 is outer interval.
106108
rhat_map4 <- g2$layers[[4]][["mapping"]]
107-
expect_identical(as.character(rhat_map4$colour), c("~", "rhat_rating"))
109+
expect_identical(rlang::as_name(rhat_map4$colour), "rhat_rating")
108110

109111
# layer 5 is bottom line.
110-
111112
rhat_map5 <- g2$layers[[5]][["mapping"]]
112-
expect_identical(as.character(rhat_map5$colour), c("~", "rhat_rating"))
113+
expect_identical(rlang::as_name(rhat_map5$colour), "rhat_rating")
113114
}
114115
})
115116

0 commit comments

Comments
 (0)