Here we are explaining how to write an R program to display “Hello World!” on the screen. We can use the built-in function print() to print the string Hello World!. For avoiding default printing of quotes make quote = FALSE. Here also describes how to concatenate the strings together.
We are using print() function for printing the string to output screen. Given below are the steps which are used in the R program to print the string. In this R program, use paste() or cat() function to concatenate the strings together in case of more than one item.
# use the print() function
print("Hello World!")
## [1] "Hello World!"
# Quotes are suppressed
print("Hello World!", quote = FALSE)
## [1] Hello World!
# If there are more than 1 item, use paste()
print(paste("Hi, ","Hello ","World"))
## [1] "Hi, Hello World"