ProjectMOSAIC / ggformula

Provides a formula interface to 'ggplot2' graphics.
Other
39 stars 11 forks source link

add support for non-syntactic variable names in formulas #152

Closed rpruim closed 2 years ago

rpruim commented 2 years ago

There may be a relatively easy fix here -- replacing deparse with as.name in a couple of calls to rapply(). Need to do some more testing to make sure there are no problems, but initial tests look good.

Note: replacing deparse(substitute()) with funtion(x) x works better.

rpruim commented 2 years ago

Doing some more testing today and cleaning up some things. Example:

suppressPackageStartupMessages(library(ggformula))

faithful |>
  dplyr::rename(`duration of eruption` = eruptions,
         `time until next eruption` = waiting) |>
  gf_point(`time until next eruption` ~ `duration of eruption`, color = ~ `duration of eruption` > 3,
           show.legend = FALSE) |>
  gf_ellipse(show.legend = FALSE)

Created on 2022-03-03 by the reprex package (v2.0.1)