[TxMt] Re: R bundle not refreshing plot(s)

Hans-Jörg Bibiko bibiko at eva.mpg.de
Sat Sep 3 12:11:53 UTC 2011


On 3 Sep 2011, at 12:55, Berend Hasselman wrote:
> On 02-09-2011, at 21:23, Berend Hasselman wrote:
>> I am running the following R code in TextMate  
>> 
>> sessionInfo()
>> x <- 1:20
>> y <- 2*x+runif(length(x), min=-2, max=2)
>> 
>> mean(y)
>> 
>> plot(x,y)
>> 
>> 
>> on Mac OS X 10.6.8 with R2.13.1 in TextMate 1.5.10 (1631) and the R.tmbundle.
>> 
>> The plot is not being refreshed every time I run the file with Command R (leaving the html window open).
>> 
>> When I close the output html window before doing Command R the plot does refresh.

> I believe the problem is caused by a recent update of WebKit, possibly the one coming with Safari 5.1
> I have (at least for now) been able to construct a workaround.


Hi Berend,

thanks for pointing out the problem. I've just fixed it. I went another way to enforce the reloading.

rndn = Time.now.to_i # random number needed to enforce reloading of cached images

print "<img width=#{width} onclick=\"TextMate.system(\'open \\'#{f}\\'\',null);\" src='file://#{f}?#{rndn}' />"


This approach avoids the generating of lots of files while having a R session.


Cheers,
--Hans



More information about the textmate mailing list