Unknown Error, not sure what to fix

data_thing <- gapminder %>%
  filter(continent == c("Americas", "Africa", "Asia")) 
#> Error in gapminder %>% filter(continent == c("Americas", "Africa", "Asia")): could not find function "%>%"

ggplot(data_thing, aes(x = gdpPercap, y = lifeExp, size = pop, color = country)) +
  geom_point() +
  theme(legend.position = "none") +
  scale_x_log10() 
#> Error in ggplot(data_thing, aes(x = gdpPercap, y = lifeExp, size = pop, : could not find function "ggplot"
  facet_wrap(~continent) +
  labs(title = "Year: {frame_time}") +
  transition_time(year) +
  shadow_wake(wake_length = 0.1, alpha = FALSE)
#> Error in facet_wrap(~continent): could not find function "facet_wrap"

Created on 2019-09-26 by the reprex package (v0.3.0)

At least in your reprex above, your functions and content can't be found without the libraries you're using (that's why you get could not find function errors).

As Mara said, you are missing library calls and also a + symbol after scale_x_log10().
This code produces an animation:

library(tidyverse)
library(gganimate)
library(gapminder)

data_thing <- gapminder %>%
    filter(continent == c("Americas", "Africa", "Asia")) 

ggplot(data_thing, aes(x = gdpPercap, y = lifeExp, size = pop, color = country)) +
    geom_point() +
    theme(legend.position = "none") +
    scale_x_log10() +
    facet_wrap(~continent) +
    labs(title = "Year: {frame_time}") +
    transition_time(year) +
    shadow_wake(wake_length = 0.1, alpha = FALSE)

file2e4c58317f1d

If you get an error message instead, then very likely you don't have a renderer program installed in your system

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.