Check to see if R has a specific capability.
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()
How severe should the consequences of the assertion be?
Either "stop", "warning", "message", or "none".
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.
# 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