3

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?

Community
  • 1
  • 1
  • All the graphics devices seem to require a file path to render a lot and cannot write directly to connections. You'd have to write it to disk, then read the bytes back into R. – MrFlick Apr 26 '17 at 20:40

0 Answers0