Defensive R Programming
Dr. Colin Gillespie
Jumping Rivers
In R, the full stop has a very special meaning
summary()
functionsummary.class_name
When you call
m <- lm(mpg ~ disp, data = mtcars)
class(m)
#[1] "lm"
So when you call
summary(m)
you end up calling
summary.lm(m)
The key point here, is that the full stop is very important
.
in variable namesDefensive R Programming