Curl error 18 occurred




I am still a beginner in R so apologies if I sound non technical.

So I am trying to get this animation on Rpubs. Basically, I have created images out of ggplot and saved as gif. now when I knit it on web it works but when I try to publish it on rpubs it gives me an error. Please see below is my code and error that I am getting.

library(purrr) # for mapping over a function
library(magick) # this is call to animate/read pngs
list.files(path = "./images/", pattern = "*.png", full.names = T) %>% 
  map(image_read) %>% # reads each path file
  image_join() %>% # joins image
  image_animate(fps=2) %>% # animates, can opt for number of loops
curl: (52) Empty reply from server
Error in uploadFunction(path, "application/x-compressed", headers, packageFile) : 
  Upload failed (curl error 52 occurred)
Calls: rpubsUpload -> uploadFunction
Execution halted

Please suggest.
Thank you


Hi, it looks like your code was not formatted correctly to make it easy to read for people trying to help you. Formatting code allows for people to more easily identify where issues may be occuring, and makes it easier to read, in general. I have edited you post to format the code properly.

In the future please put code that is inline (such as a function name, like mutate or filter) inside of backticks (`mutate`) and chunks of code can be put between sets of three backticks:

example <- foo %>%
  filter(a == 1)

This process can be done automatically by highlighting your code, either inline or in a chunk, ad clicking the </> button on the toolbar of the reply window!

This will help keep our community tidy and help you get the help you are looking for!

For more information, please take a look at the community's FAQ on formating code

As for your issue, I have never worked with magick or publishing to Rpubs so this is just a guess, but it would seem to me that when you call print, the animation is not being saved but rather simply printed to the (I assume) Viewer pane. Does the magick have a function for saving the plot?