Chapter 2 File Types and RMarkdown files

Syntax notes on using R via coding in RStudio.

  • Use the Run button to submit a command line(s). Alternatively, use Ctrl + Enter hotkey on PC (or Cmd + Enter on Mac).
  • R is case-sensitive – VERY IMPORTANT when typing in variable names.
  • Anything on a line following a number sign, #, is a comment and will be ignored.
  • Text strings must be entered with quotes around the word or phrase - correct to use " " but not correct to use “ ”.
  • R ignores extra spaces within a line of command. Use with caution and for appropriate communication reasons!
  • If you finish a command on one line, R assumes you are starting a new command on the next line. Future ways to wrap commands over multiple lines will be introduced.
  • The back arrow <- is the assignment command. For introductory use, you may instead use the equal sign = (but this is generally less “universally” understood).
  • You can go back and edit previous commands, using the mouse.

… page to be added…