[R] Display a contingency table on the X11 device
Hello, I'd like to output a table to the x11 device, but I can't seem to find an easy way to do it. Specifically, I'd like to display a 2x2 contingency table alongside a graphical plot, but can only see how to output to the console. Is there a library that can do this? Thanks for any suggestions, Parker [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Communicating with R through a named pipe: display refresh problem
> Rather, non-interactive R does not run an event loop. The usual way > around this is to use a pty, as R run from a pty is considered to be > interactive. > > (Whether a fifo and a named pipe are the same concept is moot: some OSes > have one and not the other.) > > The plan is to use threads in due course to handle X11 events. > I agree threads is the way to go. In the meantime, I also tried a looping server which doesn't block on reads to a pipe. This still doesn't refresh the display but if R has a command to refresh the display then that will probably solve the problem. # based on http://tolstoy.newcastle.edu.au/R/help/01c/2886.html stream <- fifo("R_pipe", "r", blocking=FALSE,) repeat { a <- readLines(stream) if(length(a) != 0) { e <- try(eval(parse(text = a))) if (inherits(e, "try-error")) { # error handling code here cat("Error", "\n") } } } __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Communicating with R through a named pipe: display refresh problem
Hello, On a linux system I'm trying to send commands to R through a named pipe and am *nearly* successful. I can send R commands and can plot graphs. The only problem I have is getting the x11 display to refresh - it appears to hang because of the pipe. The R server: $ mkfifo R_pipe $ R --no-save < R_pipe The R client: $ cat>> R_pipe Now, I can send R commands down the pipe: Client side: x <- seq(1,10) x Server side: > x <- seq(1:10) > x [1] 1 2 3 4 5 6 7 8 9 10 This is perfect. Now if I try to create a plot, e.g. plot(1:100), the server shows > plot(1:100) and the plot appears. However, if a window briefly obscures the graphical output, the x11 device won't refresh the display. It would appear the pipe is blocking the refresh. Can anyone else confirm this happens and any suggestions how to get the display to refresh? Thanks in advance, PJ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Graphical output: dials and meters for a dashboard?
> You can do a basic dial with something like this: > Thanks Jim. After installing plotrix I still had a bit of trouble getting this to work and I don't (yet) know enough R to fix it: > speedoplot(0.5,5,5,2,"Speedoplot") Error in polygon(xv, yv, border = border, col = col, lty = lty, lwd = lwd) : plot.new has not been called yet But the error went away if I plotted something else first. Also the colour bands are skewed - but that may just be a side-effect of my other plot. > and if you want something fancier, you can call a 3D renderer like POVRay: > > http://www.povray.org > > to render very realistic objects. Sounds interesting, but probably a bit overkill at this stage. Thanks again for coding up the dial! PJ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Graphical output: dials and meters for a dashboard?
> Here is a quick and dirty function to do so (things can easily be > changed to reflect preferences): > [...] Thanks Greg, that's working fine and is a fabulous starting point. Much appreciated! > Multiple dials can be created using par(mfrow= ... > Or the my.symbols function from the TeachingDemos package. I see there are several ways of having multiple plots: split.screen, mfcol etc. I have now got multiple dials going using split.screen, but I was wondering, are all approaches to multiple plots effectively the same or do they have different merits? Is there an approach best suited to regularly updated displays? [[replacing trailing spam]] PJ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Graphical output: dials and meters for a dashboard?
> > I'm new to R and am evaluating it to see whether it would be an appropriate > > tool to create a "dashboard" (a graphical statistical summary page). Could > > someone tell me if it is possible to display data as dials or meters. e.g. > > the four dials here: http://www.pentaho.com/images/snap_dashboard_1.png > > The question would why would you want to? You are trying to > understand your data, not driving a race car or aeroplane. You might > want to check out the books and writing of Stephen Few > (http://www.perceptualedge.com) who makes this case powerfully and > eloquently, and also suggests alternatives that are far more useful. > Thanks for the pointers to Stephen Few's work. He has some good advice on dashboard design for monitoring real-time processes which is exactly what I'm doing. PJ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Graphical output: dials and meters for a dashboard?
Hello, I'm new to R and am evaluating it to see whether it would be an appropriate tool to create a "dashboard" (a graphical statistical summary page). Could someone tell me if it is possible to display data as dials or meters. e.g. the four dials here: http://www.pentaho.com/images/snap_dashboard_1.png Browsing the site hasn't revealed anything yet. Thanks for any suggestions, PJ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.