0
0
R Programmingprogramming~3 mins

First R program in R Programming

Choose your learning style9 modes available
Introduction
We write a first R program to learn how to tell the computer what to do using R language.
When you want to see how R prints text on the screen.
When you want to check if your R setup is working.
When you want to learn the basics of R programming.
When you want to start practicing simple commands in R.
Syntax
R Programming
print("Hello, world!")
Use print() to show text or results on the screen.
Text must be inside quotes " " to tell R it is a message.
Examples
This prints the message Hello, world! on the screen.
R Programming
print("Hello, world!")
You can print any message by changing the text inside quotes.
R Programming
print("Welcome to R programming")
You can also print numbers without quotes.
R Programming
print(123)
Sample Program
This program prints a simple greeting message to show how R works.
R Programming
print("Hello, world!")
OutputSuccess
Important Notes
R shows [1] before the output to indicate the first item in the result.
Always use quotes for text messages in print().
You can run this program in RStudio or any R console.
Summary
The first R program uses print() to show messages.
Text messages must be inside quotes.
Running this program confirms your R setup works.