Use cat
:
cat("Hello World!", x, '\n')
(Note the trailing '\n'
, otherwise no newline character will be appended.)
Alternatively, you can combine the print statement with a formatting statement (sprintf
);
cat(sprintf('Hello World!%s\n', x))
The formatting syntax of sprintf
corresponds to that in C. The documentation linked above has more information.