Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fprintf

Formatted Printing (Matlab style)


Description

Formatted printing to stdout or a file.

Usage

fprintf(fmt, ..., file = "", append = FALSE)

Arguments

fmt

a character vector of format strings.

...

values passed to the format string.

file

a connection or a character string naming the file to print to; default is "" which means standard output.

append

logical; shall the output be appended to the file; default is FALSE.

Details

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-

Value

Returns invisibly the number of bytes printed (using nchar).

See Also

Examples

##  Examples:
nbytes <- fprintf("Results are:\n", file = "")
for (i in 1:10) {
    fprintf("%4d  %15.7f\n", i, exp(i), file = "")
}

pracma

Practical Numerical Math Functions

v2.3.3
GPL (>= 3)
Authors
Hans W. Borchers [aut, cre]
Initial release
2021-01-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.