@@ -255,8 +255,8 @@ mcmc_neff <- function(ratio, ..., size = NULL) {
255255 linetype = 2 ,
256256 linewidth = 0.25 ) +
257257 labs(y = NULL , x = expression(N [eff ]/ N )) +
258- scale_fill_diagnostic(" neff " ) +
259- scale_color_diagnostic(" neff " ) +
258+ scale_fill_diagnostic(" neff_ratio " ) +
259+ scale_color_diagnostic(" neff_ratio " ) +
260260 scale_x_continuous(
261261 breaks = breaks ,
262262 # as.character truncates trailing zeroes, while ggplot default does not
@@ -287,8 +287,8 @@ mcmc_neff_hist <- function(ratio, ..., binwidth = NULL, bins = NULL, breaks = NU
287287 binwidth = binwidth ,
288288 bins = bins ,
289289 breaks = breaks ) +
290- scale_color_diagnostic(" neff " ) +
291- scale_fill_diagnostic(" neff " ) +
290+ scale_color_diagnostic(" neff_ratio " ) +
291+ scale_fill_diagnostic(" neff_ratio " ) +
292292 labs(x = expression(N [eff ]/ N ), y = NULL ) +
293293 dont_expand_y_axis(c(0.005 , 0 )) +
294294 yaxis_title(FALSE ) +
@@ -424,27 +424,19 @@ diagnostic_points <- function(size = NULL) {
424424
425425# Functions wrapping around scale_color_manual() and scale_fill_manual(), used to
426426# color the intervals by rhat value
427- scale_color_diagnostic <- function (diagnostic = c(" rhat" , " neff " )) {
428- d <- match.arg(diagnostic , choices = c( " rhat " , " neff " , " neff_ratio " ) )
427+ scale_color_diagnostic <- function (diagnostic = c(" rhat" , " neff_ratio " )) {
428+ d <- match.arg(diagnostic )
429429 diagnostic_color_scale(d , aesthetic = " color" )
430430}
431431
432- scale_fill_diagnostic <- function (diagnostic = c(" rhat" , " neff " )) {
433- d <- match.arg(diagnostic , choices = c( " rhat " , " neff " , " neff_ratio " ) )
432+ scale_fill_diagnostic <- function (diagnostic = c(" rhat" , " neff_ratio " )) {
433+ d <- match.arg(diagnostic )
434434 diagnostic_color_scale(d , aesthetic = " fill" )
435435}
436436
437- normalize_diagnostic_name <- function (diagnostic ) {
438- diagnostic <- match.arg(diagnostic , choices = c(" rhat" , " neff" , " neff_ratio" ))
439- if (diagnostic == " neff" ) {
440- diagnostic <- " neff_ratio"
441- }
442- diagnostic
443- }
444-
445437diagnostic_color_scale <- function (diagnostic = c(" rhat" , " neff_ratio" ),
446438 aesthetic = c(" color" , " fill" )) {
447- diagnostic <- normalize_diagnostic_name (diagnostic )
439+ diagnostic <- match.arg (diagnostic )
448440 aesthetic <- match.arg(aesthetic )
449441 dc <- diagnostic_colors(diagnostic , aesthetic )
450442 do.call(
@@ -460,7 +452,7 @@ diagnostic_color_scale <- function(diagnostic = c("rhat", "neff_ratio"),
460452
461453diagnostic_colors <- function (diagnostic = c(" rhat" , " neff_ratio" ),
462454 aesthetic = c(" color" , " fill" )) {
463- diagnostic <- normalize_diagnostic_name (diagnostic )
455+ diagnostic <- match.arg (diagnostic )
464456 aesthetic <- match.arg(aesthetic )
465457 color_levels <- c(" light" , " mid" , " dark" )
466458 if (diagnostic == " neff_ratio" ) {
0 commit comments