diff --git a/R/modify_columns.R b/R/modify_columns.R index 21fe317ae..595b5d603 100644 --- a/R/modify_columns.R +++ b/R/modify_columns.R @@ -2234,13 +2234,15 @@ cols_add <- function( #' #' @param missing_vals *Treatment of missing values* #' -#' `singl-kw:[gap|zero|remove]` // *default:* `"gap"` +#' `singl-kw:[gap|marker|zero|remove]` // *default:* `"gap"` #' #' If missing values are encountered within the input data, there are three -#' strategies available for their handling: (1) `"gap"` will display data gaps -#' at the sites of missing data, where data lines will have discontinuities; -#' (2) `"zero"` will replace `NA` values with zero values; and (3) `"remove"` -#' will remove any incoming `NA` values. +#' strategies available for their handling: (1) `"gap"` will show data gaps +#' at the sites of missing data, where data lines will have discontinuities +#' and bar plots will have missing bars; (2) `"marker"` will behave like +#' `"gap"` but show prominent visual marks at the missing data locations; (3) +#' `"zero"` will replace `NA` values with zero values; and (4) `"remove"` will +#' remove any incoming `NA` values. #' #' @param autoscale *Automatically set x- and y-axis scale limits based on data* #' @@ -2742,7 +2744,7 @@ cols_nanoplot <- function( rows = everything(), plot_type = c("line", "bar", "boxplot"), plot_height = "2em", - missing_vals = c("gap", "zero", "remove"), + missing_vals = c("gap", "marker", "zero", "remove"), autoscale = FALSE, autohide = TRUE, columns_x_vals = NULL, diff --git a/R/utils_plots.R b/R/utils_plots.R index 076afd6fc..9660d92af 100644 --- a/R/utils_plots.R +++ b/R/utils_plots.R @@ -29,7 +29,7 @@ generate_nanoplot <- function( x_vals = NULL, expand_x = NULL, expand_y = NULL, - missing_vals = c("gap", "zero", "remove"), + missing_vals = c("gap", "marker", "zero", "remove"), all_y_vals = NULL, all_single_y_vals = NULL, plot_type = c("line", "bar"), @@ -895,7 +895,7 @@ generate_nanoplot <- function( if (is.na(data_y_points[i])) { - if (missing_vals == "gap") { + if (missing_vals == "marker") { # Create a symbol that should denote that a # missing value is present @@ -905,7 +905,7 @@ generate_nanoplot <- function( "cx=\"", data_x_points[i], "\" ", "cy=\"", safe_y_d + (data_y_height / 2), "\" ", "r=\"", data_point_radius_i + (data_point_radius_i / 2), "\" ", - "stroke=\"red\" ", + "stroke=\"", "red", "\" ", "stroke-width=\"", data_point_stroke_width_i, "\" ", "fill=\"white\" ", ">", @@ -956,7 +956,7 @@ generate_nanoplot <- function( if (is.na(data_y_points[i])) { - if (missing_vals == "gap") { + if (missing_vals == "marker") { # Create a symbol that should denote that a # missing value is present diff --git a/man/cols_nanoplot.Rd b/man/cols_nanoplot.Rd index 38ad7d338..c1a327227 100644 --- a/man/cols_nanoplot.Rd +++ b/man/cols_nanoplot.Rd @@ -10,7 +10,7 @@ cols_nanoplot( rows = everything(), plot_type = c("line", "bar", "boxplot"), plot_height = "2em", - missing_vals = c("gap", "zero", "remove"), + missing_vals = c("gap", "marker", "zero", "remove"), autoscale = FALSE, autohide = TRUE, columns_x_vals = NULL, @@ -81,13 +81,15 @@ images inserted via \code{\link[=fmt_image]{fmt_image()}} (also having a \code{" \item{missing_vals}{\emph{Treatment of missing values} -\verb{singl-kw:[gap|zero|remove]} // \emph{default:} \code{"gap"} +\verb{singl-kw:[gap|marker|zero|remove]} // \emph{default:} \code{"gap"} If missing values are encountered within the input data, there are three -strategies available for their handling: (1) \code{"gap"} will display data gaps -at the sites of missing data, where data lines will have discontinuities; -(2) \code{"zero"} will replace \code{NA} values with zero values; and (3) \code{"remove"} -will remove any incoming \code{NA} values.} +strategies available for their handling: (1) \code{"gap"} will show data gaps +at the sites of missing data, where data lines will have discontinuities +and bar plots will have missing bars; (2) \code{"marker"} will behave like +\code{"gap"} but show prominent visual marks at the missing data locations; (3) +\code{"zero"} will replace \code{NA} values with zero values; and (4) \code{"remove"} will +remove any incoming \code{NA} values.} \item{autoscale}{\emph{Automatically set x- and y-axis scale limits based on data}