Mistakes in the first R session

Several things that go wrong and confuse people on the first R session (this was going to be a top ten list but I ran out of ideas).

  • if your network connection is wonky (we were working in a room with spotty wireless connectivity) you will have trouble choosing a mirror (if R is trying to retrieve the full list of mirrors from cran.r-project.org), retrieving a list of available packages, or downloading packages.
  • after you use install.packages()} to install a package (or use the Packages menu), you still need to use {{library() to load it before you can use any of the functions in the package or access help on any of those functions.
  • math notation: you must use *, not juxtaposition, to indicate multiplication; you must use ^, not superscripting, to raise a number to a power.
  • when in doubt, try it! if something has gone wrong at the end of a long list of commands, go back and look at the intermediate results. It is very difficult to break R by running a bad command, so if you're wondering what a particular command would do, go ahead and see what happens.
  • Be careful with parentheses. Continuation characters (+) most often indicate that you have forgotten to close a parenthesis. However, just because the expression is complete doesn't mean it is correct.
  • I have a note, "dynamic", scribbled to myself, but I don't know what it means.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License