FILE: Macros in Package '@R_PACKAGE_NAME@'

FILER Documentation

Macros in Package '@R_PACKAGE_NAME@'

Description

FILE() and LINE() are intended to be used in a similar manner to the macros __FILE__ and __LINE__ in C. They are useful for generating a diagnostic message / / warning / / error to about the status of the program.

Usage

FILE()
LINE()

Examples

FILE.R <- tempfile(fileext = ".R")
writeLines("fun <- function ()
{
    message(sprintf('invalid value %d at %s, line %d',
        -1, FILE(), LINE()))
}
", FILE.R)
source(FILE.R, verbose = FALSE, keep.source = TRUE)
fun()
unlink(FILE.R)

ArcadeAntics/this.path documentation built on Sept. 27, 2024, 1:45 p.m.