Use the convert tool on ‘imagemagick’ to convert the jpg files into pdf. Get the docker image from here (dockerhub), instead of installing it locally.

## Pull image
docker pull dpokidov/imagemagick
## Run the convert command
## -v to mount the volume
## --entrypoint to use the command from imagemagick
## jpg files are in /img/input_*.jpg and produce /imgs/output.pdf
docker run --entrypoint=convert \
-v /Documents/local-images/:/imgs dpokidov/imagemagick \
'/imgs/input_*.jpg' /imgs/output.pdf

Hopefully, this helps me reduce some future googling.

--

--

Data :

https://www.kaggle.com/rohanrao/formula-1-world-championship-1950-2020

Code:

library(tidyverse)
dat <- read_csv('drivers.csv')
color_scheme <- c("#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7", "#fdbb84", "#bcbddc", "#a6bddb")dat %>%
group_by(nationality) %>%
count() %>%
filter(n > 20) %>%
ggplot(aes(x = reorder(nationality, n), y = n)) +
geom_bar(aes(fill=nationality), stat = "identity") +
ggtitle("Number of F1 drivers by Nationality (till 2020)") +
xlab("Nationality") +
ylab("Number of drivers") +
coord_flip() +
scale_fill_manual(values = my_scheme) +
geom_text(aes(label = n), size = 4, hjust = 1.5) +
theme(legend.position = "none") +
theme_minimal()
ggsave('f1_plot', device = "png", dpi = 500)

--

--