I've created a plot in R using ggplot2 (base plot works here too). I'd like to "convert" it to binary form and save it in my SQL Server database as a varbinary(max). Is this clear? Is this possible?
As an analog, in C#, I can accomplish this by creating a Bitmap image, saving it to a MemoryStream object, converting it via ToArray(), then saving it in SQL Server as SqlDbType.Binary. (i.e. this process: Save and retrieve image (binary) from SQL Server using Entity Framework 6)
So can I do something like this in R?