Both beginning and experienced R programmers make these common mistakes. When you run your program, and it generates an errors, first check the following errors before you waste additional time troubleshooting the error:

  1. Using the wrong case—help(), Help(), and HELP() are three different functions (only the help() will work).
  2. Forgetting to use quotation marks when they’re needed—install.packages-(“gclus”) works, whereas install.packages(gclus) generates an error.
  3. Forgetting to include the parentheses in a function call— For example, help() works, but help doesn’t. Even if there are no options, you still need the ()
  4. Using the \ in a pathname on Windows— R sees the backslash character as an escape character. setwd(“c:\mydata”) generates an error. Use setwd(“c:/mydata”) or setwd(“c:\\mydata”) instead.
  5. Using a function from a package that’s not loaded— The function order.clusters() is contained in the gclus package. If you try to use it before loading the package, you’ll get an error.