R.utils (version 1.6.4)

printf: C-style formatted output

Description

C-style formatted output.

Usage

## S3 method for class 'default}(fmt, ..., sep="", file="")':
printfundefined

fmt{A character vector of format strings.
    See same argument for sprintf().}
 ...{Additional arguments sprintf().}
 sep{A character vector of strings to append after each element.}
 file{A connection, or a character of a file to print to.
    See same argument for cat().}

Returns nothing.

cat("Hello world
")
  printf("Hello world
")

  x <- 1.23
  cat(sprintf("x=%.2f
", x))
  printf("x=%.2f
", x)

  y <- 4.56
  cat(sprintf(c("x=%.2f
", "y=%.2f
"), c(x,y)), sep="")
  printf(c("x=%.2f
", "y=%.2f
"), c(x,y))

[object Object]

For C-style formatting of character strings, see sprintf().


utilities

Arguments