fprintf.RdFormatted printing to stdout or a file.
fprintf(fmt, ..., file = "", append = FALSE)fprintf applies the format string fmt to all input
data ... and writes the result to standard output or a file.
The usual C-style string formatting commands are used-
Returns invisibly the number of bytes printed (using nchar).
## Examples:
nbytes <- fprintf("Results are:\n", file = "")
#> Results are:
for (i in 1:10) {
fprintf("%4d %15.7f\n", i, exp(i), file = "")
}
#> 1 2.7182818
#> 2 7.3890561
#> 3 20.0855369
#> 4 54.5981500
#> 5 148.4131591
#> 6 403.4287935
#> 7 1096.6331584
#> 8 2980.9579870
#> 9 8103.0839276
#> 10 22026.4657948