How to build a custom R graphics device 0 ▲ Notes from a data witch 2 hours ago · 75 min read14977 words · Tech · hide · 0 comments For the longest time, graphics devices in R have been a mystery to me. Yes, I know a lot about how to create graphics in R: I can create some rather lovely data visualisations with ggplot2, I can write grid code directly, and I can use base R graphics when I need to. But this code operates at a level of abstraction one step above the creation of the image itself: in all cases, what these tools do is send instructions to an R graphics device. This device is the thing responsible for taking the R code and transforming it into a graphic of some kind. Depending on what kind of device you’re using, this output could be an on-screen image, a png file, a jpeg, an svg file, or any of a number of other possibilities. Since my very earliest days of using R I have always wondered what in the everliving fuck actually happens at this step. Graphics devices are rather opaque and mysterious entities, in large part because you can’t write them in R: all the work is done in C, with a thin R wrapper… No comments yet. Log in to reply on the Fediverse. Comments will appear here.