[R] Help deeded: Does a R graphical function return something special?

HU,ZHENGJUN hhu at ufl.edu
Fri Oct 19 22:40:12 CEST 2007


Hi All,

  When I tried to catch a returned value from a R graphical 
function or command (e.g., plot, lines, points, abline, title, 
xyplot, etc.), I always get a NULL value if it is executed 
correctly. For example:
  x <- c(1,2,3,4,5,9,13,19,36)
  plot.Comm <- plot(x) # plot.Comm <- try(eval(plot(x)))

then plot.Comm has a NULL value. Obviously, this is not a good way 
to check if or not it is a graphical function or command since 
plot.Comm <- NULL also lets plot.Comm be NULL.

Does anyone knows:

(1) that a R graphical function or command (e.g., plot, lines, 
points, abline, title, xyplot, etc.) could return something 
special if it is run correctly, which is different from those 
returned from executing any R non-graphical functions or 
commands?

(2) that there is an easy way for a R programmer to know that a R 
function or command is a graphical one before executing it?

  Thank you very much for the help in advance.
  Have a good weekend!
  Howard



More information about the R-help mailing list