Learn R Programming

nimble (version 1.2.1)

nimPrint: print function for use in nimbleFunctions

Description

print function for use in nimbleFunctions

Usage

nimPrint(...)

Arguments

...

an abitrary set of arguments that will be printed in sequence.

Details

The keyword print in nimbleFunction run-time code will be automatically turned into nimPrint. This is a function that prints its arguments in order using cat in R, or using std::cout in C++ code generated by compiling nimbleFunctions. Non-scalar numeric objects can be included, although their output will be formatted slightly different in uncompiled and compiled nimbleFunctions.

For numeric values, the number of digits printed is controlled by the system option nimbleOptions('digits').

See Also

Examples

Run this code
ans <- matrix(1:4, nrow = 2) ## R code, not NIMBLE code
nimPrint('Answer is ', ans) ## would work in R or NIMBLE

Run the code above in your browser using DataLab