Learn R Programming

assertive.reflection (version 0.0-5)

assert_r_has_jpeg_capability: Does R have a capability?

Description

Check to see if R has a specific capability.

Usage

assert_r_has_jpeg_capability(
  severity = getOption("assertive.severity", "stop")
)

assert_r_has_png_capability(severity = getOption("assertive.severity", "stop"))

assert_r_has_tiff_capability( severity = getOption("assertive.severity", "stop") )

assert_r_has_tcltk_capability( severity = getOption("assertive.severity", "stop") )

assert_r_has_x11_capability(severity = getOption("assertive.severity", "stop"))

assert_r_has_aqua_capability( severity = getOption("assertive.severity", "stop") )

assert_r_has_http_ftp_capability( severity = getOption("assertive.severity", "stop") )

assert_r_has_sockets_capability( severity = getOption("assertive.severity", "stop") )

assert_r_has_libxml_capability( severity = getOption("assertive.severity", "stop") )

assert_r_has_fifo_capability( severity = getOption("assertive.severity", "stop") )

assert_r_has_cledit_capability( severity = getOption("assertive.severity", "stop") )

assert_r_has_iconv_capability( severity = getOption("assertive.severity", "stop") )

assert_r_has_nls_capability(severity = getOption("assertive.severity", "stop"))

assert_r_has_rprof_capability( severity = getOption("assertive.severity", "stop") )

assert_r_has_profmem_capability( severity = getOption("assertive.severity", "stop") )

assert_r_has_cairo_capability( severity = getOption("assertive.severity", "stop") )

assert_r_has_icu_capability(severity = getOption("assertive.severity", "stop"))

assert_r_has_long_double_capability( severity = getOption("assertive.severity", "stop") )

assert_r_has_libcurl_capability( severity = getOption("assertive.severity", "stop") )

r_has_jpeg_capability()

r_has_png_capability()

r_has_tiff_capability()

r_has_tcltk_capability()

r_has_x11_capability()

r_has_aqua_capability()

r_has_http_ftp_capability()

r_has_sockets_capability()

r_has_libxml_capability()

r_has_fifo_capability()

r_has_cledit_capability()

r_has_iconv_capability()

r_has_nls_capability()

r_has_rprof_capability()

r_has_profmem_capability()

r_has_cairo_capability()

r_has_icu_capability()

r_has_long_double_capability()

r_has_libcurl_capability()

Arguments

severity

How severe should the consequences of the assertion be? Either "stop", "warning", "message", or "none".

Value

The is_* functions return TRUE if R has the capability and FALSE (with a cause) otherwise. The assert_* functions return nothing but throw an error if the corresponding is_* function returns FALSE.

See Also

capabilities

Examples

Run this code
# NOT RUN {
if(r_has_png_capability())
{
  png("test.png")
  with(cars, plot(speed, dist))
  dev.off()
} else 
{
  pdf("test.pdf")
  with(cars, plot(speed, dist))
  dev.off()
}
# }

Run the code above in your browser using DataLab