mysql - Save R plot to web server -


I am trying to create a process that removes data from a MySQL server (using the RODBC package) , Some statistical routes do so on the data in R, then save the generated plots back to the server, as they can recover in a web browser through a small PHP and web magic.

To save a plot in my plan, use the RODBC package to execute a SQL insertion in the MySQL Blob field. I think I insert data as straight string. The problem is, how do I get the data string and will it also work? My best idea is to use the SavePlot function to save the template file and then read it anyway.

Has anybody suggested this before or how to approach it?

Even if you think this is a terrible idea, here is the answer to a work which I Was able to piece together

  ## Open Connective Library (RODBC) channel & lt; - ODBC Connect ("") ## Plot a Plot and give it to a Temple File x & lt; - Rnorm (100,0,1) Hist (ex, ("Temp.jpg", type = "jpeg") ## to return to the temporary file binary plot_binary - paste (readBin ("temp.jpg", " Enter "sqlQuery (channel, paste (" test values ​​(1, x '", plot_binary,' '), sep =" "in a table," = "raw", N = 1e6), collapse = "" ## )) # Before implementation, I will definitely find some soul to make sure that it should be used instead of using this server file system. 


Comments