StatisticsNZ / simplevis

Simple visualisation with ggplot2 and leaflet wrappers
https://StatisticsNZ.github.io/simplevis
Other
86 stars 11 forks source link

Bug: error where numeric x_var & facet_scales = "free" #441

Open davidhodge931 opened 2 years ago

davidhodge931 commented 2 years ago
library(simplevis)
library(palmerpenguins)

gg_point_facet(penguins, 
               x_var = bill_length_mm, 
               y_var = body_mass_g, 
               facet_var = species, 
               facet_scales = "free")
davidhodge931 commented 2 years ago

delete warning add args add param doc

if (is.logical(y_var_vctr)) { data <- data %>% dplyr::mutate(dplyr::across(!!y_var, ~factor(.x, levels = c("TRUE", "FALSE"))))

y_var_vctr <- dplyr::pull(data, !!y_var)

}

if (is.character(y_var_vctr) | is.factor(y_var_vctr)) { if (y_rev == FALSE) { data <- data %>% dplyr::mutate(dplyr::across(!!y_var, ~forcats::fct_rev(.x))) }

y_var_vctr <- dplyr::pull(data, !!y_var)

}

Then copy and paste long x/y scale code

davidhodge931 commented 2 years ago

add *_na_rm