Categories: R Series

How do I comment in R?

Comment lines include the line of code or any sort of information that mainly specifies the other programmers (apart from the one who designed the code) about the functionality of that particular piece of code where the comment lines are included. The use of these comment lines is that it makes the program more precise. 

In the R language, the comment lines act as the helping text. Comment lines are ignored by the interpreter when the program is being executed.

Types of Comments

  • Single-line comments- Comment that only needs one line
  • Multi-line Comments- Comment that requires more than one line.
  • Documentation Comments- Comments that drafted usually for a quick documentation lookup

The basic syntax of using a single comment

# My first comment in R 

To comment a single line in RStudio, we can put “#” before each line.

But when we want to comment multiple lines at one go, we can use following in RStuido

In Windows: CTRL + SHIFT + C

In OS-X: COMMAND + SHIFT + C
# My first multiline comment
# Line 2
# Line 3
# End of multiline comment

and for uncommenting the multiple lines at once, use the same

In Windows: CTRL + SHIFT + C

In OS-X: COMMAND + SHIFT + C

Conclusion

Hence, we saw how to make comments in R.

This brings the end of this Blog. We really appreciate your time.

Hope you liked it.

Do visit our page www.zigya.com/blog for more informative blogs on Data Science

Keep Reading! Cheers!

Zigya Academy
BEING RELEVANT

Zigya Acadmey

Share
Published by
Zigya Acadmey

Recent Posts

Understanding Standard Form of Numbers: An Explanation With Examples

Through the standard form offers different advantages in mathematical calculations and scientific notation. Firstly, it…

5 months ago

How to deal with stress and anxiety in college

Introduction Stress is a feeling caused by an external trigger that makes us frustrated, such…

6 months ago

Why is Sociology Important These Days?

Sociology is a broad discipline that examines societal issues. It looks at the meaningful patterns…

6 months ago

How to Convert Inches to mm

Some info about Inch Inches are a unique measure that persuades us that even the…

8 months ago

Antilogarithms – Definition, Methods, and Examples

You should be familiar with logarithms to understand antilogarithms in a better manner. Logarithms involve…

10 months ago

नाटककार सुरेंद्र वर्मा

यहां "नाटककार सुरेंद्र वर्मा" पुस्तक की पीडीएफ विद्यार्थी, शोधार्थी और जो इसका अभ्यास के लिए…

10 months ago