As we get started, we will need help, let’s work on how and where to find that help, and also how to act on it.
We will need help
Most modern software applications strive to ensure we get what we want without thinking too much about either the ends or the means. An application might, as soon as we start it, ask us what we want or show us what we might want: to write a letter; to input data; to read our emails. We might need help, in R, to work out what we want.
— Think about the advantage of not having to think about what we want, now think about the disadvantage.
Most applications will present the options for getting what we want as choices in a menu. You usually have to learn where the appropriate menu is e.g. in SPSS, find the analysis menu then either the general linear model menu for ANOVA or the regression menu for regression. In R, you write commands (function calls) to get what you want.
— What if you want something not on the menu, what if, anyway, the option splits do not make sense (ANOVA is, actually, a special case of regression)?
Most applications will give you one way to do any thing. In R, you will usually have more than one (often, several) different ways to do a thing.
— Which way do you choose? This is a decision based on (for me) answers to the questions: does it work (now)? do I understand why it works?
R is a case-sensitive, interpreted language.
— If you spell an object name incorrectly, if you get the syntax wrong, if you muddle letter case, you will get an error.
The error messages can be cryptic.
How and where to find help
As noted previously, there are plenty of places to get help. Here’s what I do:
1. Looking for a function, trying to work out what options to use with a function, use in-built help:
— type: ?[name of function] or help([name of function]) or ??[name of function]
where [name of function] from [ to ] inclusive is the name of the function you want help with e.g. help(ggplot)
2. google search something like this: “in R [name of function or text of error message]” will very often take you to a post on stackoverflow or some R blog where the error or problem and the solution or multiple alternate solutions (this is R) will be described or explained for you.
3. Use a book – there are several good ones
What to do with the help
Try it out. Learning how to use R involves some experimentation. Copy the code from a reported solution into a script, try running it and see if it works.
Every problem you ever have will already have been solved by someone else and, in R, the solution will be reported online.
What have we learnt?
You will need help in R, but there is a lot of it and you can just work on how and where to find it, then what to do with it.