Skip to content

dplyr variable autocompletion struggles with combined dplyr / ggplot2 chains #14342

Open

Description

@kevinushey

Maybe last tiny thing is that newly created variables show in the first aes() call, but not in the following ones.

Shown: (note that some variables are missing, but this issue is a broader issue (that shows in other context) Opened #14311 to track this.
image
Not shown
image

library(tidyverse)
mtcars |>
  tibble::rownames_to_column() |> 
  mutate(
    xz = vs ** 2,
    label = glue::glue("{rowname}, {hp}"),
    aaa = ifelse(gear >= 3, "yes", "no"),
    s2 = vs**2,
    f1 = case_when(
      s2 > 100 ~"Yes",
      .default = "No"
    )
  ) |>
  ggplot(aes(x = xz, y = disp)) +
  geom_point()+ 
  ggrepel::geom_text_repel(
    aes(label = label) # No new variable suggestion shown.
  )

(Took a while to isolate things, but I think I have a good understanding now!)

Originally posted by @olivroy in #8444 (comment)

Activity

  1. added
    autocompletion
    on Feb 28, 2024
  2. added this to the Later milestone on Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    autocompletionbug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions