Thanks for the suggestions. So I ran this (just learnt about reprex - thank you):
p <- ggplot(
gapminder,
aes(x = gdpPercap, y=lifeExp, size = pop, colour = country)
) +
geom_point(show.legend = FALSE, alpha = 0.7) +
scale_color_viridis_d() +
scale_size(range = c(2, 12)) +
scale_x_log10() +
labs(x = "GDP per capita", y = "Life expectancy")
#> Error in ggplot(gapminder, aes(x = gdpPercap, y = lifeExp, size = pop, : could not find function "ggplot"
p
#> Error in eval(expr, envir, enclos): object 'p' not found
p + transition_time(year) +
labs(title = "Year: {frame_time}")
#> Error in eval(expr, envir, enclos): object 'p' not found
file_renderer(dir = ".", prefix = "gganim_plot", overwrite = FALSE)
#> Error in file_renderer(dir = ".", prefix = "gganim_plot", overwrite = FALSE): could not find function "file_renderer"
Created on 2019-11-20 by the reprex package (v0.3.0)
And no joy. I get the following:
99 /var/folders/qk/n8zc5v7j06v13bzvvlmm2jxm0000gn/T//RtmpRRQzVz/48c95be18abc/gganim_plot0099.png
100 /var/folders/qk/n8zc5v7j06v13bzvvlmm2jxm0000gn/T//RtmpRRQzVz/48c95be18abc/gganim_plot0100.png
Warning message:
file_renderer failed to copy frames to the destination directory
file_renderer(dir = ".", prefix = "gganim_plot", overwrite = FALSE)
function (frames, fps)
{
if (!dir.exists(dir))
dir.create(dir, showWarnings = FALSE, recursive = TRUE)
new_names <- file.path(dir, sub("gganim_plot", prefix, basename(frames)))
if (any(!file.copy(frames, new_names, overwrite = overwrite))) {
warning("file_renderer failed to copy frames to the destination directory",
call. = FALSE)
}
invisible(new_names)
}
<bytecode: 0x7facfce74930>
<environment: 0x7face179b770>
Any clue? Apologies as I really can't overstate how green I am to all this! (I grew up with an abacus)
Christian