HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Comments can be used to explain R code, and to make it more readable. It can also be used to prevent execution when testing alternative code
Comments can be used to explain R code, and to make it more readable. It can also be used to prevent execution when testing alternative code.
Comments starts with a #
. When executing code, R will ignore anything
that starts with #
.
This example uses a comment before a line of code:
# This is a comment
"Hello World!"
This example uses a comment at the end of a line of code:
"Hello World!"
# This is a comment
Comments does not have to be text to explain the code, it can also be used to prevent R from executing the code:
# "Good morning!"
"Good night!"
Unlike other programming languages, such as Java, there are no syntax in R for multiline comments. However, we can just insert a #
for each line
to create multiline comments:
# This is a comment
# written in
# more than just one line
"Hello World!"