[kepler-dev] RExpression image output

Dan Higgins higgins at nceas.ucsb.edu
Thu Dec 13 10:17:23 PST 2007


Hi Tristan,
    You are correct that the output of an added line to create a png 
using bitmap will not appear on the graphicsFileName port. But the file 
is created with a known filename in the added 'bitmap' statement. So the 
'hack' is to add another output port to the RExpression actor and name 
it with a variable whose value is the name of the png file created. You 
thus have the filename output but not on the graphicsFileName port.

    The problem with this is that it requires a special setup to run 
some R code on a server. But the 'bitmap' graphics device won't run on 
most desktop machines since most Windows boxes (and Macs) do not have 
GhostScript installed. So I am hesitant to change the baseline code to 
allow options that won't work on most machines. I don't know if you were 
thinking of having some kind of translator that would convert users' 
workflows to use graphics devices that your server can handle to create 
web pages?

    One option might be to figure out just which X11 library R is using 
to create pngs and install that on your server. This would (presumably) 
allow existing RExpression graphics to work on your machine and thus not 
require global changes to everyone's code. [I am guessing that you 
really don't need all of X11 !]

Dan

Tristan King wrote:
> On Thu, 2007-12-06 at 06:51 -0800, Dan Higgins wrote:
>   
>> Hi Tristan,
>>     You are perfectly correct about the preset graphics device crashing 
>> R. What I forgot is that the 'png' code added at the start can be 
>> 'turned off' by setting the Graphics Output parameter to false!  (see 
>> line #322). You should then be able to customize the graphicsDevice 
>> within the script.
>>
>>     
>
> Turning the Graphics Output parameter off stops the png code from being
> added, but when it is turned off, even if i add the bitmap() line to the
> expression code, graphicsDevice (initialised at #320) is never set, and
> thus the graphicsFileName port never sees any output (see #553). The png
> file still gets written, but there is no reference to it in the
> workflow. So as far as I can tell, there is no way to get around this
> problem without editing the RExpression actor's code.
>
> -Tristan
>
>
>   


-- 
*******************************************************************
Dan Higgins                                  higgins at nceas.ucsb.edu
http://www.nceas.ucsb.edu/    Ph: 805-893-5127
National Center for Ecological Analysis and Synthesis (NCEAS) Marine Science Building - Room 3405
Santa Barbara, CA 93195
*******************************************************************



More information about the Kepler-dev mailing list