I suggest reading the answers to this question . I was able to solve the problem by:
install.packages("installr") install.packages("magick")