You need to install libmagick++-dev first. Then you can install the R package "magick."
To install libmagick++-dev, run the following commands on the Ubuntu terminal.
sudo apt update
sudo apt-get install -y libmagick++-dev
Once the installation of libmagick++-dev is finished, you can install the R package.