Comments
Comments are notes written inside the code that are not executed.
They are used to explain the purpose of code, provide context, or temporarily deactivate lines during debugging.
Creating Comments
To add a comment, use the # symbol. Everything after # on the same line will be ignored by R.
Example
12# A standalone comment 11 + 3 # Adding eleven and three
In this example, the console displays only the result of 11 + 3 and ignores the comments.
Best Practices
- Use comments to clarify complex parts of the code;
- Avoid over-commenting, as it can clutter the script;
- Use comments to disable lines temporarily during debugging.
Swipe to start coding
This code mixes plain-text descriptions and R commands. Disable the non-executable text lines by prefixing them with #, leaving only the valid R commands active.
Solución
¡Gracias por tus comentarios!
single
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla
Genial!
Completion tasa mejorada a 2.27
Comments
Desliza para mostrar el menú
Comments are notes written inside the code that are not executed.
They are used to explain the purpose of code, provide context, or temporarily deactivate lines during debugging.
Creating Comments
To add a comment, use the # symbol. Everything after # on the same line will be ignored by R.
Example
12# A standalone comment 11 + 3 # Adding eleven and three
In this example, the console displays only the result of 11 + 3 and ignores the comments.
Best Practices
- Use comments to clarify complex parts of the code;
- Avoid over-commenting, as it can clutter the script;
- Use comments to disable lines temporarily during debugging.
Swipe to start coding
This code mixes plain-text descriptions and R commands. Disable the non-executable text lines by prefixing them with #, leaving only the valid R commands active.
Solución
¡Gracias por tus comentarios!
single