davidhodge931 / ggblanket

Simplify ggplot2 visualisation
https://davidhodge931.github.io/ggblanket/
Other
149 stars 8 forks source link

internals: update to remove reference to limits with NA #918

Closed davidhodge931 closed 1 month ago

davidhodge931 commented 1 month ago
library(tidyverse)
library(ggblanket)
library(palmerpenguins)

set_blanket()

penguins |> 
  gg_point(
    x = body_mass_g, 
    y = flipper_length_mm, 
    x_limits = c(2875, max(penguins$body_mass_g, na.rm = TRUE)),
  ) +
  geom_vline(xintercept = 2875)

penguins %>% #or this pipe
  gg_point(
    x = body_mass_g, 
    y = flipper_length_mm, 
    x_limits = c(2875, max(.$body_mass_g, na.rm = TRUE)), #and then you can use .
  ) +
  geom_vline(xintercept = 2875)
davidhodge931 commented 1 month ago

Done