Closed dicook closed 1 year ago
Oh, it is because there is a computing problem, not that it is missing:
Error in `dplyr::mutate()`:
! Problem while computing `y_minor =
rlang::exec(unique(params$y_scale), .data$y_minor)`.
ℹ The error occurred in group 1: group = -113.8.-21.2.
Caused by error in `unique.default()`:
! unique() applies only to vectors
Run `rlang::last_error()` to see where the error occurred.
x/y_scale
needs to be specified as a string rather than a function. Would be worthwhile to document it in the @param:
library(cubble)
library(ggplot2)
range01 <- GGally::range01
#> Registered S3 method overwritten by 'GGally':
#> method from
#> +.gg ggplot2
GGally::nasa %>%
ggplot(aes(x_major = long, x_minor = day,
y_major = lat, y_minor = ozone)) +
geom_glyph_box(fill=NA) +
geom_glyph_line() +
geom_glyph(y_scale = "range01", polar = TRUE) +
ggthemes::theme_map()
Created on 2022-09-23 by the reprex package (v2.0.1)
This needs to be a change within {cubble}
to support functions directly.
Strings should not be documented that they are supported.
Broken example
local({
library(GGally)
library(cubble)
my_custom_function <- GGally::range01
p <- ggplot(data = GGally::nasa,
aes(x_major = long, x_minor = day,
y_major = lat, y_minor = surftemp)) +
geom_glyph_box() +
geom_glyph_line() +
geom_glyph(y_scale = "my_custom_function") +
theme_bw()
print(p)
})
#> Error in `dplyr::mutate()`:
#> ℹ In argument: `y_minor = rlang::exec(unique(params$y_scale), .data$y_minor)`.
#> ℹ In group 1: `group = -113.8.-21.2`.
#> Caused by error in `my_custom_function()`:
#> ! could not find function "my_custom_function"
#> Run `rlang::last_error()` to see where the error occurred.
Fixing this would also allow removal of all quosures from https://github.com/ggobi/ggally/pull/433
I'll have a PR and fixes to https://github.com/ggobi/ggally/pull/433 shortly
In converting from
to
will throw an error. cubble is missing the range01 function, that will scale each spatial location data to range between 0 and 1, necessary to make polar glyphs with local scale.