Error in R Snippets but not R Views

Hey Julian,

thanks for your reply. I assumed that everything is correct since the R View is working without problems and “basic” scripts work in the R Snippets work as well.

I looked a bit in the forum and in the source code and found the difference:

It seems like for some code you need to open a plotting device first to be used. If I add

require(Cairo)
options(device = 'png',bitmapType='cairo')

the snippet runs through.
I wonder if opening a device should be made standard in your R integration, since there are a lot of packages that silently try to open a device although you are not expecting them to plot anything (useful). I did not see anything popping up when running my snippet in RStudio for example. At least I think it should be noted somewhere or an option should exist in the R Snippet config dialogue.

2 Likes