Check Foreign Function Calls


Performs checks on calls to compiled code from R code. Currently only checks whether the interface functions such as .C and .Fortran are called with a "NativeSymbolInfo" first argument or with argument PACKAGE specified, which is highly recommended to avoid name clashes in foreign function calls.


checkFF(package, dir, file, lib.loc = NULL,
        registration = FALSE, check_DUP = FALSE,
        verbose = getOption("verbose"))



a character string naming an installed package. If given, the installed R code of the package is checked.


a character string specifying the path to a package's root source directory. This should contain the subdirectory ‘R’ (for R code). Only used if package is not given.


the name of a file containing R code to be checked. Used if neither package nor dir are given.


a character vector of directory names of R libraries, or NULL. The default value of NULL corresponds to all libraries currently known. The specified library trees are used to search for package.


a logical. If TRUE, checks the registration information on the call (if available).


a logical. If TRUE, .C and .Fortran calls with DUP = FALSE are reported.


a logical. If TRUE, additional diagnostics are printed (and the result is returned invisibly).


Note that we can only check if the name argument is a symbol or a character string, not what class of object the symbol resolves to at run-time.

If the package has a namespace which contains a useDynLib directive, calls in top-level functions in the package are not reported as their symbols will be preferentially looked up in the DLL named in the first useDynLib directive.

This checks that calls with PACKAGE specified are to the same package, and reports separately those which are in base packages and those which are in other packages (and if those packages are specified in the ‘DESCRIPTION’ file).


An object of class "checkFF".

There are format and print methods to display the information contained in such objects.

See Also

.C, .Fortran; Foreign.


 # order is pretty much random
checkFF(package = "stats", verbose = TRUE)

Want to suggest features or report bugs for Use the GitHub issue tracker. Vote for new features on Trello.

comments powered by Disqus