How to print in R without the initial [1]

r

#1

Hello,

I wanted to print something in R without the initial [1].

print(“f”)
[1] “f”

I want to get just ->
“f”

instead of it.
How to do this?
Thanks


#2

Try cat(). You must, however, include a newline character for the next prompt to appear beneath what’s printed.

> cat("f")
f> cat("f\n")
f
>