We didn't give you many details, but you've obviously figured out the basics, or you would've thrown this book away in frustration!
Frustration is natural when you start programming in R, because it is such a stickler for punctuation, and even one character out of place will cause it to complain.
But while you should expect to be a little frustrated, take comfort in that it's both typical and temporary: it happens to everyone, and the only way to get over it is to keep trying.
Before we go any further, let's make sure you've got a solid foundation in running R code, and that you know about some of the most helpful RStudio features.
Comments can be helpful for briefly describing what the subsequent code does.
```{r}
# define primes
primes <- c(1, 2, 3, 5, 7, 11, 13)
# multiply primes by 2
primes * 2
```
With short pieces of code like this, it might not be necessary to leave a command for every single line of code.
But as the code you're writing gets more complex, comments can save you (and your collaborators) a lot of time in figuring out what was done in the code.
However, ultimately, *what* was done is possible to figure out, even if it might be tedious at times, as the code is self-documenting.
However, remembering or figuring out *why* something was done can be much more difficult, or impossible.
For example, `geom_smooth()`, which draws a smooth curve to represent the patterns of the data has an argument called `span`, which controls the "wiggliness" of the smoother with larger values for `span` yielding a smoother curve.
The default value of this argument is 0.75.
Suppose you decide to change the value of `span`, and set it to 0.3.
It would be very useful to add a comment noting why you decided to make this change, for yourself in the future and others reviewing your code.
In the following example the first comment for the same code is not as good as the second one as it doesn't say why the decision to change the span was made.
To inspect this object, try out RStudio's completion facility: type "this", press TAB, add characters until you have a unique prefix, then press return.
There's an implied contract between you and R: it will do the tedious computation for you, but in return, you must be completely precise in your instructions.