In this tutorial you will learn about the R Comments and its application with practical example.
R Comments
Comments are a set of statements that are ignored by the R interpreter. The use of comments makes it easy for humans to understand the source code. Usually comments gives you inside or explanation about the variable, method, class or any statement that exists in source code. The comment statements are ignored during the execution of the program.
Single-line Comments:-
A hash sign (#) is used to specify a single line comment, which extends up to the newline character.
1 2 |
# This is a single comment print("Hello World") # It prints Hello World |
Multi-line Comments:-
If you want to comment multiple lines then you can do it using hash sign (#) as follows –
1 2 3 |
# This is a multi line comment, line 1. # This is a multi line comment, line 2. # This is a multi line comment, line n. |