Skip to content

Commit

Permalink
Fix #521
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhodge931 committed Nov 7, 2023
1 parent ce01d40 commit 22c3967
Show file tree
Hide file tree
Showing 41 changed files with 255 additions and 245 deletions.
12 changes: 6 additions & 6 deletions R/gg_area.R
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ gg_area <- function(
y_vars_str <- "^y$|^ymin$|^ymax$|^yend$|^ymin_final$|^ymax_final$"

x_vctr_temp <- plot_data %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(x_vars_str)), \(x) !rlang::is_na(x))) %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(x_vars_str)), \(x) !is.na(x))) %>%
dplyr::select(tidyselect::matches(stringr::regex(x_vars_str)))

if (ncol(x_vctr_temp) != 0) {
Expand Down Expand Up @@ -792,10 +792,10 @@ gg_area <- function(
if (any(x_trans %in% "reverse")) x_limits <- sort(x_limits, decreasing = TRUE)
}
else if (!rlang::is_null(x_limits)) {
if (rlang::is_na(x_limits[1])) {
if (is.na(x_limits[1])) {
x_limits[1] <- x_range[1]
}
if (rlang::is_na(x_limits[2])) {
if (is.na(x_limits[2])) {
x_limits[2] <- x_range[2]
}

Expand Down Expand Up @@ -941,7 +941,7 @@ gg_area <- function(
y_vars_str <- "^y$|^ymin$|^ymax$|^yend$|^ymin_final$|^ymax_final$"

y_vctr_temp <- plot_data %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(y_vars_str)), \(x) !rlang::is_na(x))) %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(y_vars_str)), \(x) !is.na(x))) %>%
dplyr::select(tidyselect::matches(stringr::regex(y_vars_str)))

if (ncol(y_vctr_temp) != 0) {
Expand Down Expand Up @@ -1055,8 +1055,8 @@ gg_area <- function(
if (any(y_trans %in% "reverse")) y_limits <- sort(y_limits, decreasing = TRUE)
}
else if (!rlang::is_null(y_limits)) {
if (rlang::is_na(y_limits[1])) y_limits[1] <- y_range[1]
if (rlang::is_na(y_limits[2])) y_limits[2] <- y_range[2]
if (is.na(y_limits[1])) y_limits[1] <- y_range[1]
if (is.na(y_limits[2])) y_limits[2] <- y_range[2]

if (!rlang::is_null(y_include)) y_limits <- range(c(y_limits, y_include))

Expand Down
12 changes: 6 additions & 6 deletions R/gg_bar.R
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ gg_bar <- function(
y_vars_str <- "^y$|^ymin$|^ymax$|^yend$|^ymin_final$|^ymax_final$"

x_vctr_temp <- plot_data %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(x_vars_str)), \(x) !rlang::is_na(x))) %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(x_vars_str)), \(x) !is.na(x))) %>%
dplyr::select(tidyselect::matches(stringr::regex(x_vars_str)))

if (ncol(x_vctr_temp) != 0) {
Expand Down Expand Up @@ -797,10 +797,10 @@ gg_bar <- function(
if (any(x_trans %in% "reverse")) x_limits <- sort(x_limits, decreasing = TRUE)
}
else if (!rlang::is_null(x_limits)) {
if (rlang::is_na(x_limits[1])) {
if (is.na(x_limits[1])) {
x_limits[1] <- x_range[1]
}
if (rlang::is_na(x_limits[2])) {
if (is.na(x_limits[2])) {
x_limits[2] <- x_range[2]
}

Expand Down Expand Up @@ -946,7 +946,7 @@ gg_bar <- function(
y_vars_str <- "^y$|^ymin$|^ymax$|^yend$|^ymin_final$|^ymax_final$"

y_vctr_temp <- plot_data %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(y_vars_str)), \(x) !rlang::is_na(x))) %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(y_vars_str)), \(x) !is.na(x))) %>%
dplyr::select(tidyselect::matches(stringr::regex(y_vars_str)))

if (ncol(y_vctr_temp) != 0) {
Expand Down Expand Up @@ -1060,8 +1060,8 @@ gg_bar <- function(
if (any(y_trans %in% "reverse")) y_limits <- sort(y_limits, decreasing = TRUE)
}
else if (!rlang::is_null(y_limits)) {
if (rlang::is_na(y_limits[1])) y_limits[1] <- y_range[1]
if (rlang::is_na(y_limits[2])) y_limits[2] <- y_range[2]
if (is.na(y_limits[1])) y_limits[1] <- y_range[1]
if (is.na(y_limits[2])) y_limits[2] <- y_range[2]

if (!rlang::is_null(y_include)) y_limits <- range(c(y_limits, y_include))

Expand Down
12 changes: 6 additions & 6 deletions R/gg_bin_2d.R
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ gg_bin_2d <- function(
y_vars_str <- "^y$|^ymin$|^ymax$|^yend$|^ymin_final$|^ymax_final$"

x_vctr_temp <- plot_data %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(x_vars_str)), \(x) !rlang::is_na(x))) %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(x_vars_str)), \(x) !is.na(x))) %>%
dplyr::select(tidyselect::matches(stringr::regex(x_vars_str)))

if (ncol(x_vctr_temp) != 0) {
Expand Down Expand Up @@ -818,10 +818,10 @@ gg_bin_2d <- function(
if (any(x_trans %in% "reverse")) x_limits <- sort(x_limits, decreasing = TRUE)
}
else if (!rlang::is_null(x_limits)) {
if (rlang::is_na(x_limits[1])) {
if (is.na(x_limits[1])) {
x_limits[1] <- x_range[1]
}
if (rlang::is_na(x_limits[2])) {
if (is.na(x_limits[2])) {
x_limits[2] <- x_range[2]
}

Expand Down Expand Up @@ -967,7 +967,7 @@ gg_bin_2d <- function(
y_vars_str <- "^y$|^ymin$|^ymax$|^yend$|^ymin_final$|^ymax_final$"

y_vctr_temp <- plot_data %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(y_vars_str)), \(x) !rlang::is_na(x))) %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(y_vars_str)), \(x) !is.na(x))) %>%
dplyr::select(tidyselect::matches(stringr::regex(y_vars_str)))

if (ncol(y_vctr_temp) != 0) {
Expand Down Expand Up @@ -1081,8 +1081,8 @@ gg_bin_2d <- function(
if (any(y_trans %in% "reverse")) y_limits <- sort(y_limits, decreasing = TRUE)
}
else if (!rlang::is_null(y_limits)) {
if (rlang::is_na(y_limits[1])) y_limits[1] <- y_range[1]
if (rlang::is_na(y_limits[2])) y_limits[2] <- y_range[2]
if (is.na(y_limits[1])) y_limits[1] <- y_range[1]
if (is.na(y_limits[2])) y_limits[2] <- y_range[2]

if (!rlang::is_null(y_include)) y_limits <- range(c(y_limits, y_include))

Expand Down
12 changes: 6 additions & 6 deletions R/gg_blank.R
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ gg_blank <- function(
y_vars_str <- "^y$|^ymin$|^ymax$|^yend$|^ymin_final$|^ymax_final$"

x_vctr_temp <- plot_data %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(x_vars_str)), \(x) !rlang::is_na(x))) %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(x_vars_str)), \(x) !is.na(x))) %>%
dplyr::select(tidyselect::matches(stringr::regex(x_vars_str)))

if (ncol(x_vctr_temp) != 0) {
Expand Down Expand Up @@ -1156,10 +1156,10 @@ gg_blank <- function(
if (any(x_trans %in% "reverse")) x_limits <- sort(x_limits, decreasing = TRUE)
}
else if (!rlang::is_null(x_limits)) {
if (rlang::is_na(x_limits[1])) {
if (is.na(x_limits[1])) {
x_limits[1] <- x_range[1]
}
if (rlang::is_na(x_limits[2])) {
if (is.na(x_limits[2])) {
x_limits[2] <- x_range[2]
}

Expand Down Expand Up @@ -1305,7 +1305,7 @@ gg_blank <- function(
y_vars_str <- "^y$|^ymin$|^ymax$|^yend$|^ymin_final$|^ymax_final$"

y_vctr_temp <- plot_data %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(y_vars_str)), \(x) !rlang::is_na(x))) %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(y_vars_str)), \(x) !is.na(x))) %>%
dplyr::select(tidyselect::matches(stringr::regex(y_vars_str)))

if (ncol(y_vctr_temp) != 0) {
Expand Down Expand Up @@ -1419,8 +1419,8 @@ gg_blank <- function(
if (any(y_trans %in% "reverse")) y_limits <- sort(y_limits, decreasing = TRUE)
}
else if (!rlang::is_null(y_limits)) {
if (rlang::is_na(y_limits[1])) y_limits[1] <- y_range[1]
if (rlang::is_na(y_limits[2])) y_limits[2] <- y_range[2]
if (is.na(y_limits[1])) y_limits[1] <- y_range[1]
if (is.na(y_limits[2])) y_limits[2] <- y_range[2]

if (!rlang::is_null(y_include)) y_limits <- range(c(y_limits, y_include))

Expand Down
12 changes: 6 additions & 6 deletions R/gg_boxplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ gg_boxplot <- function(
y_vars_str <- "^y$|^ymin$|^ymax$|^yend$|^ymin_final$|^ymax_final$"

x_vctr_temp <- plot_data %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(x_vars_str)), \(x) !rlang::is_na(x))) %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(x_vars_str)), \(x) !is.na(x))) %>%
dplyr::select(tidyselect::matches(stringr::regex(x_vars_str)))

if (ncol(x_vctr_temp) != 0) {
Expand Down Expand Up @@ -797,10 +797,10 @@ gg_boxplot <- function(
if (any(x_trans %in% "reverse")) x_limits <- sort(x_limits, decreasing = TRUE)
}
else if (!rlang::is_null(x_limits)) {
if (rlang::is_na(x_limits[1])) {
if (is.na(x_limits[1])) {
x_limits[1] <- x_range[1]
}
if (rlang::is_na(x_limits[2])) {
if (is.na(x_limits[2])) {
x_limits[2] <- x_range[2]
}

Expand Down Expand Up @@ -946,7 +946,7 @@ gg_boxplot <- function(
y_vars_str <- "^y$|^ymin$|^ymax$|^yend$|^ymin_final$|^ymax_final$"

y_vctr_temp <- plot_data %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(y_vars_str)), \(x) !rlang::is_na(x))) %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(y_vars_str)), \(x) !is.na(x))) %>%
dplyr::select(tidyselect::matches(stringr::regex(y_vars_str)))

if (ncol(y_vctr_temp) != 0) {
Expand Down Expand Up @@ -1060,8 +1060,8 @@ gg_boxplot <- function(
if (any(y_trans %in% "reverse")) y_limits <- sort(y_limits, decreasing = TRUE)
}
else if (!rlang::is_null(y_limits)) {
if (rlang::is_na(y_limits[1])) y_limits[1] <- y_range[1]
if (rlang::is_na(y_limits[2])) y_limits[2] <- y_range[2]
if (is.na(y_limits[1])) y_limits[1] <- y_range[1]
if (is.na(y_limits[2])) y_limits[2] <- y_range[2]

if (!rlang::is_null(y_include)) y_limits <- range(c(y_limits, y_include))

Expand Down
12 changes: 6 additions & 6 deletions R/gg_col.R
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ gg_col <- function(
y_vars_str <- "^y$|^ymin$|^ymax$|^yend$|^ymin_final$|^ymax_final$"

x_vctr_temp <- plot_data %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(x_vars_str)), \(x) !rlang::is_na(x))) %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(x_vars_str)), \(x) !is.na(x))) %>%
dplyr::select(tidyselect::matches(stringr::regex(x_vars_str)))

if (ncol(x_vctr_temp) != 0) {
Expand Down Expand Up @@ -803,10 +803,10 @@ gg_col <- function(
if (any(x_trans %in% "reverse")) x_limits <- sort(x_limits, decreasing = TRUE)
}
else if (!rlang::is_null(x_limits)) {
if (rlang::is_na(x_limits[1])) {
if (is.na(x_limits[1])) {
x_limits[1] <- x_range[1]
}
if (rlang::is_na(x_limits[2])) {
if (is.na(x_limits[2])) {
x_limits[2] <- x_range[2]
}

Expand Down Expand Up @@ -952,7 +952,7 @@ gg_col <- function(
y_vars_str <- "^y$|^ymin$|^ymax$|^yend$|^ymin_final$|^ymax_final$"

y_vctr_temp <- plot_data %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(y_vars_str)), \(x) !rlang::is_na(x))) %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(y_vars_str)), \(x) !is.na(x))) %>%
dplyr::select(tidyselect::matches(stringr::regex(y_vars_str)))

if (ncol(y_vctr_temp) != 0) {
Expand Down Expand Up @@ -1066,8 +1066,8 @@ gg_col <- function(
if (any(y_trans %in% "reverse")) y_limits <- sort(y_limits, decreasing = TRUE)
}
else if (!rlang::is_null(y_limits)) {
if (rlang::is_na(y_limits[1])) y_limits[1] <- y_range[1]
if (rlang::is_na(y_limits[2])) y_limits[2] <- y_range[2]
if (is.na(y_limits[1])) y_limits[1] <- y_range[1]
if (is.na(y_limits[2])) y_limits[2] <- y_range[2]

if (!rlang::is_null(y_include)) y_limits <- range(c(y_limits, y_include))

Expand Down
12 changes: 6 additions & 6 deletions R/gg_contour.R
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ gg_contour <- function(
y_vars_str <- "^y$|^ymin$|^ymax$|^yend$|^ymin_final$|^ymax_final$"

x_vctr_temp <- plot_data %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(x_vars_str)), \(x) !rlang::is_na(x))) %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(x_vars_str)), \(x) !is.na(x))) %>%
dplyr::select(tidyselect::matches(stringr::regex(x_vars_str)))

if (ncol(x_vctr_temp) != 0) {
Expand Down Expand Up @@ -865,10 +865,10 @@ gg_contour <- function(
if (any(x_trans %in% "reverse")) x_limits <- sort(x_limits, decreasing = TRUE)
}
else if (!rlang::is_null(x_limits)) {
if (rlang::is_na(x_limits[1])) {
if (is.na(x_limits[1])) {
x_limits[1] <- x_range[1]
}
if (rlang::is_na(x_limits[2])) {
if (is.na(x_limits[2])) {
x_limits[2] <- x_range[2]
}

Expand Down Expand Up @@ -1014,7 +1014,7 @@ gg_contour <- function(
y_vars_str <- "^y$|^ymin$|^ymax$|^yend$|^ymin_final$|^ymax_final$"

y_vctr_temp <- plot_data %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(y_vars_str)), \(x) !rlang::is_na(x))) %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(y_vars_str)), \(x) !is.na(x))) %>%
dplyr::select(tidyselect::matches(stringr::regex(y_vars_str)))

if (ncol(y_vctr_temp) != 0) {
Expand Down Expand Up @@ -1128,8 +1128,8 @@ gg_contour <- function(
if (any(y_trans %in% "reverse")) y_limits <- sort(y_limits, decreasing = TRUE)
}
else if (!rlang::is_null(y_limits)) {
if (rlang::is_na(y_limits[1])) y_limits[1] <- y_range[1]
if (rlang::is_na(y_limits[2])) y_limits[2] <- y_range[2]
if (is.na(y_limits[1])) y_limits[1] <- y_range[1]
if (is.na(y_limits[2])) y_limits[2] <- y_range[2]

if (!rlang::is_null(y_include)) y_limits <- range(c(y_limits, y_include))

Expand Down
12 changes: 6 additions & 6 deletions R/gg_contour_filled.R
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ gg_contour_filled <- function(
y_vars_str <- "^y$|^ymin$|^ymax$|^yend$|^ymin_final$|^ymax_final$"

x_vctr_temp <- plot_data %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(x_vars_str)), \(x) !rlang::is_na(x))) %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(x_vars_str)), \(x) !is.na(x))) %>%
dplyr::select(tidyselect::matches(stringr::regex(x_vars_str)))

if (ncol(x_vctr_temp) != 0) {
Expand Down Expand Up @@ -859,10 +859,10 @@ gg_contour_filled <- function(
if (any(x_trans %in% "reverse")) x_limits <- sort(x_limits, decreasing = TRUE)
}
else if (!rlang::is_null(x_limits)) {
if (rlang::is_na(x_limits[1])) {
if (is.na(x_limits[1])) {
x_limits[1] <- x_range[1]
}
if (rlang::is_na(x_limits[2])) {
if (is.na(x_limits[2])) {
x_limits[2] <- x_range[2]
}

Expand Down Expand Up @@ -1008,7 +1008,7 @@ gg_contour_filled <- function(
y_vars_str <- "^y$|^ymin$|^ymax$|^yend$|^ymin_final$|^ymax_final$"

y_vctr_temp <- plot_data %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(y_vars_str)), \(x) !rlang::is_na(x))) %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(y_vars_str)), \(x) !is.na(x))) %>%
dplyr::select(tidyselect::matches(stringr::regex(y_vars_str)))

if (ncol(y_vctr_temp) != 0) {
Expand Down Expand Up @@ -1122,8 +1122,8 @@ gg_contour_filled <- function(
if (any(y_trans %in% "reverse")) y_limits <- sort(y_limits, decreasing = TRUE)
}
else if (!rlang::is_null(y_limits)) {
if (rlang::is_na(y_limits[1])) y_limits[1] <- y_range[1]
if (rlang::is_na(y_limits[2])) y_limits[2] <- y_range[2]
if (is.na(y_limits[1])) y_limits[1] <- y_range[1]
if (is.na(y_limits[2])) y_limits[2] <- y_range[2]

if (!rlang::is_null(y_include)) y_limits <- range(c(y_limits, y_include))

Expand Down
12 changes: 6 additions & 6 deletions R/gg_crossbar.R
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ gg_crossbar <- function(
y_vars_str <- "^y$|^ymin$|^ymax$|^yend$|^ymin_final$|^ymax_final$"

x_vctr_temp <- plot_data %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(x_vars_str)), \(x) !rlang::is_na(x))) %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(x_vars_str)), \(x) !is.na(x))) %>%
dplyr::select(tidyselect::matches(stringr::regex(x_vars_str)))

if (ncol(x_vctr_temp) != 0) {
Expand Down Expand Up @@ -886,10 +886,10 @@ gg_crossbar <- function(
if (any(x_trans %in% "reverse")) x_limits <- sort(x_limits, decreasing = TRUE)
}
else if (!rlang::is_null(x_limits)) {
if (rlang::is_na(x_limits[1])) {
if (is.na(x_limits[1])) {
x_limits[1] <- x_range[1]
}
if (rlang::is_na(x_limits[2])) {
if (is.na(x_limits[2])) {
x_limits[2] <- x_range[2]
}

Expand Down Expand Up @@ -1035,7 +1035,7 @@ gg_crossbar <- function(
y_vars_str <- "^y$|^ymin$|^ymax$|^yend$|^ymin_final$|^ymax_final$"

y_vctr_temp <- plot_data %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(y_vars_str)), \(x) !rlang::is_na(x))) %>%
dplyr::filter(dplyr::if_any(tidyselect::matches(stringr::regex(y_vars_str)), \(x) !is.na(x))) %>%
dplyr::select(tidyselect::matches(stringr::regex(y_vars_str)))

if (ncol(y_vctr_temp) != 0) {
Expand Down Expand Up @@ -1149,8 +1149,8 @@ gg_crossbar <- function(
if (any(y_trans %in% "reverse")) y_limits <- sort(y_limits, decreasing = TRUE)
}
else if (!rlang::is_null(y_limits)) {
if (rlang::is_na(y_limits[1])) y_limits[1] <- y_range[1]
if (rlang::is_na(y_limits[2])) y_limits[2] <- y_range[2]
if (is.na(y_limits[1])) y_limits[1] <- y_range[1]
if (is.na(y_limits[2])) y_limits[2] <- y_range[2]

if (!rlang::is_null(y_include)) y_limits <- range(c(y_limits, y_include))

Expand Down
Loading

0 comments on commit 22c3967

Please sign in to comment.