yutannihilation / gghighlight

Highlight points and lines in ggplot2

Home Page:https://yutannihilation.github.io/gghighlight/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cryptic error for typo in argument name

yutannihilation opened this issue · comments

This doesn't work:

library(gapminder)
library(gganimate)
#> Loading required package: ggplot2
library(gghighlight)

ggplot(gapminder, aes(gdpPercap, lifeExp, size = pop, colour = country)) +
  geom_point(alpha = 0.7, show.legend = FALSE) +
  gghighlight(use_direct_labels = FALSE) +
  scale_colour_manual(values = country_colors) +
  scale_size(range = c(2, 12)) +
  scale_x_log10() +
  facet_wrap(~continent) +
  # Here comes the gganimate specific bits
  labs(title = 'Year: {frame_time}', x = 'GDP per capita', y = 'life expectancy') +
  transition_time(year) +
  ease_aes('linear')
#> label_key: country
#> Error: Faceting variables must have at least one value

Created on 2019-02-11 by the reprex package (v0.2.1)

Something is wrong...

library(gapminder)
library(gghighlight)
#> Loading required package: ggplot2

ggplot(gapminder, aes(gdpPercap, lifeExp, size = pop, colour = country)) +
  geom_point(alpha = 0.7, show.legend = FALSE) +
  gghighlight(use_direct_labels = FALSE)
#> label_key: country

Created on 2019-02-11 by the reprex package (v0.2.1)

Okay, this was just a typo of use_direct_label...

library(gapminder)
library(gganimate)
#> Loading required package: ggplot2
library(gghighlight)

ggplot(gapminder, aes(gdpPercap, lifeExp, size = pop, colour = country)) +
  geom_point(alpha = 0.7, show.legend = FALSE) +
  gghighlight(use_direct_label = FALSE) +
  scale_colour_manual(values = country_colors) +
  scale_size(range = c(2, 12)) +
  scale_x_log10() +
  facet_wrap(~continent) +
  # Here comes the gganimate specific bits
  labs(title = 'Year: {frame_time}', x = 'GDP per capita', y = 'life expectancy') +
  transition_time(year) +
  ease_aes('linear')

Created on 2019-03-09 by the reprex package (v0.2.1)