I\'m looking for how to do printf in r, ie I want to type:
printf(\"hello %d\\n\", 56 )
and get the same output as typing:
If you want a function that does print(sprintf(...)), define a function that does that.
printf <- function(...)print(sprintf(...)) printf("hello %d\n", 56) ## [1] "hello 56\n" d <- printf("hello %d\n", 56) ## [1] "hello 56\n" d ## [1] "hello 56\n"