Get startedGet started for free

A little bit dotty

1. A little bit dotty

The full stop is a simple little bit of punctuation, but used in the wrong place in R, can cause chaos.

2. The full stop

In R, the full stop has a very special meaning. It's part of how R does S3 object oriented programming. Briefly, when you call the summary function, R looks for a function called summary dot class name. Notice the dot - it has meaning!

3. Example: the summary() function

For example. When we fit a simple linear regression model using the L-M function. The class of the regression model is L M

4. Example: the summary() function

We usually examine the model using the summary function. In R, what actually happens is you call the function summary dot LM The key point, is that the dot has meaning!

5. One bit of advice

There are very few R rules that everyone agrees on. But everyone agrees that you should avoid using full stops in variable or function names.

6. The final stop

Let's practice