How can I determine if a function generates a graph

Posted by Colin Gillespie on Stack Overflow See other posts from Stack Overflow or by Colin Gillespie
Published on 2010-04-30T09:15:37Z Indexed on 2010/04/30 9:17 UTC
Read the original article Hit count: 153

Filed under:
|

Is there a way to determine if a function generates a figure in R?

For example, if we have functions f and g

f = function(x,y){plot(x,y)}
g = function(x,y){mean(x*y)}

I would like able to run

createFigure(f(x,y))#Returns TRUE
createFigure(g(x,y))#Returns FALSE

Thanks

© Stack Overflow or respective owner

Related posts about r

    Related posts about graphics