R Tutorial

If you have never worked with a command line based progam such as IDL, Mathematica, or Matlab before R can seem intimidating. However with a little practice you should be able to complete simple tasks in no time.

The two most importat things to keep in mind when dealing with any command line based program are syntax and help files.

Syntax is the form in which you give the program commands, it can be looked at as the grammer of the program. You must always use the correct syntax when giving the program commands or it will not understand you. It is important to realize the the grammer of a computer is much more sensitive than the english language, and so you must input all commands EXACTLY correct. A missed colan, an extra bracket, or any other small error will either cause to program to do something other than what you wanted, or in most cases not do anything at all.

Fortunatly there are help files which can be acessed through the program which will help you with the syntax of a given command. When using R you can always find when the exact syntax of a command is by typing in help(command) for example if you wanted to know what the syntax for the plot command was you would type help(plot). If you cannot find the exact command you can do a search of all commands by typing in ??keyword where the keyword is part of the command you are looking for. So if for instance you forgot what the command is for making a histogram you could type ??histogram which will then bring up a list of all commands with the word histogram in their description.