Learn R Programming

rapport (version 0.31)

makes.plot: Check plot creation

Description

This function checks if given expression generates a plot.

Usage

makes.plot(cmd)

Arguments

cmd
an expression that is to be tested

Value

  • a logical value

References

See original thread for more details (http://stackoverflow.com/a/2744434/457898). Special thanks to Hadley Wickham for this one!

Examples

Run this code
makes.plot(plot(rnorm(100))) # returns TRUE
    makes.plot(sample(10))       # returns FALSE

Run the code above in your browser using DataLab