Animation of something

Your task is to create animation, where “red dot” is flying around the globe.

For example something like this:

One possible solution:

Start libraries:

library(tidyverse)
library(sf)
library(tmap)
library(magick)

access some world data:

data(World)

Plot the world map as the globe:

ggplot(data = World) +
  theme_void()+
  theme(panel.grid = element_line(color = "slategray1", size= .25))+
  geom_sf(fill = "olivedrab", size= .25, col = "grey80") +
  coord_sf(crs = "+proj=laea +lat_0=35 +lon_0=25 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs ")

Create The Flying Dot:

fly <- tibble(x = 0, y = 50)

fly_sf <- st_as_sf(fly, coords = c("x", "y"), crs = 4326)

Starting point

ggplot(data = World) +
  theme_void()+
  theme(panel.grid = element_line(color = "slategray1", size= .25))+
  geom_sf(fill = "olivedrab", size= .25, col = "grey80") +
  geom_sf(data= fly_sf, col = "red", size= 2)+
  coord_sf(crs = "+proj=laea +lat_0=35 +lon_0=25 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs ")

Put it to fly!!!

Upload the R-code and nicely designed document (html, pdf, doc, etc) to Moodle!

Author: Anto Aasa
Supervisors: Anto Aasa & Lika Zhvania
LTOM.02.041
Last update: 2022-12-07 11:43:13