Note the addition of distinct() (and replace "var_you_want" with the name of the variable). I figured this out by taking a look at the dataset produced. There were multiple rows for a given order, so essentially the title was feeding it a vector of length > 1. Using distinct will reduce it to one observation, so that pull just grabs one string.
@johnjoire
This works for me:
labs(title="{names_for_plotting |> filter(order==closest_state) |> distinct(var_you_want) |> pull(var_you_want)}")
Note the addition of
distinct()
(and replace "var_you_want" with the name of the variable). I figured this out by taking a look at the dataset produced. There were multiple rows for a given order, so essentially the title was feeding it a vector of length > 1. Using distinct will reduce it to one observation, so that pull just grabs one string.