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?

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. Commented Apr 26, 2017 at 20:40

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.