Skip to content

Sending graphics output to connections

2 messages · Brian Ripley, Tim Churches

#
What would you like to be able to stream?  Most Web-based graphics is
bitmapped, and it is not useful to stream individual bitmapped files, as
they only come into existence when the device is closed.  Postscript is
streamable: the planned PDF is not (streaming PDF over the web depends on
byte-addressing and sending the trailer first).

In so far as I can envisage what you want to do, it would suffice to write
a graphic plot via, say, png, then send the file to a socket via readBin
once socket connections are in place.

[BTW, the only problem with socket connections I can see is handling
packet sizing and end issues, where you need to know more than just the
raw socket details, and things like proxies and firewalls.]
On Sat, 27 Jan 2001, Tim Churches wrote:

            

  
    
#
In the first issue of the excellent R news, Brian D. Ripley muses [1]:

"What can I do with connections? ... In short, almost everything you used to
do with files. The exceptions are the graphics devices which write to files,
and it is not yet clear if it is beneficial to be able to send graphics
outputs to connections. ..."

One benefit would be the ability to stream graphics back to a (possibly
remote) client of the R session, such as a Web browser or even an "R thin
client" which communicates with an R process on a server somewhere. The
other part of this scenario, that is, remote controlling an R session from a
socket, is, as Prof. Ripley notes, already planned and can currently be
fudged in V1.2.1 with an explicit loop reading and evaluating lines of input
from a pipe connection as illustrated in the article.

[1] Ripley BD. Connections. <I>R News</I> 2001;1(1):16-17. Available at
http://cran.r-project.org/doc/Rnews/ Accessed on 2001-Jan-27.

(<I>...</I> denotes italics. I think that is the correct citation for an
e-journal in Vancouver format, but would appreciate suggestions or
corrections.)

Tim Churches


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._