Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

investigate facet_var specification in g_boxplot.R #200

Open
chlebowa opened this issue Jul 14, 2023 · 1 comment
Open

investigate facet_var specification in g_boxplot.R #200

chlebowa opened this issue Jul 14, 2023 · 1 comment

Comments

@chlebowa
Copy link
Contributor

if (!is.null(facet_var)) {

facet_var defaults to NULL for no faceting but can also be set to "None" for no faceting. This seems redundant. Investigate whether the "None" case can be discarded and simplify accordingly.

 # Add facetting.
  if (!is.null(facet_var)) {
    if (facet_var != "None" & facet_var %in% names(data)) {
      if (!is_finite(facet_ncol)) facet_ncol <- 0
      if (facet_ncol >= 1) {
        plot1 <- plot1 +
          ggplot2::facet_wrap(stats::as.formula(paste0(" ~ ", facet_var)), ncol = round(facet_ncol))
      } else {
        plot1 <- plot1 +
          ggplot2::facet_wrap(stats::as.formula(paste0(" ~ ", facet_var)))
      }
    }
  }
@npaszty
Copy link
Contributor

npaszty commented Jul 14, 2023

@chlebowa
this does seem odd. perhaps relictual to when faceting may have been a radio button vs. checkbox?

grep for "None" in *.R only reveals the following.

g_boxplot.R:#' @param facet_var variable to facet the plot by, or "None" if no faceting
g_boxplot.R: if (facet_var != "None" & facet_var %in% names(data)) { # nolint

I guess there are other files to search too but for starters...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants