Rows: 168 Columns: 4
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (2): country, income_group
dbl (2): democ_score, infect_rate
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
tail(disease_democ)
# A tibble: 6 × 4
country income_group democ_score infect_rate
<chr> <chr> <dbl> <dbl>
1 Turkey Upper middle income 54.8 39
2 Panama Upper middle income 46 40
3 Gabon Upper middle income 34.6 41
4 Venezuela, RB Upper middle income 41.6 42
5 Colombia Upper middle income 44.8 43
6 Brazil Upper middle income 37.2 45
head(disease_democ)
# A tibble: 6 × 4
country income_group democ_score infect_rate
<chr> <chr> <dbl> <dbl>
1 Bahrain High income: non-OECD 45.6 23
2 Bahamas, The High income: non-OECD 48.4 24
3 Qatar High income: non-OECD 50.4 24
4 Latvia High income: non-OECD 52.8 25
5 Barbados High income: non-OECD 46 26
6 Singapore High income: non-OECD 64 26
No renderer backend detected. gganimate will default to writing frames to separate files
Consider installing:
- the `gifski` package for gif output
- the `av` package for video output
and restarting the R session
library(gapminder)# Create a basic scatter plotp <-ggplot(gapminder, aes(gdpPercap, lifeExp,size = pop, color = continent)) +geom_point(alpha =0.7) +scale_color_viridis_d() +scale_size(range =c(2, 12)) +scale_x_log10() +labs(title ="Year: {frame_time}",x ="GDP per capita",y ="Life expectancy" )anim <- p +transition_time(year) +ease_aes("linear")anim
Warning: No renderer available. Please install the gifski, av, or magick package to
create animated output