Basic tips

  • Hit Ctrl+Enter (Windows) or Command+Enter (Mac) to run a single line or a selection of codes
  • Everything after a pound sign (#) is a commentary, so R does not evaluate (run) the code after a pound sign
  • Basic terminology:
        function(arg1, arg2, arg3, ...)    e.g.,  sqrt(x = 36)
         |         |    |    |                      |   |   |
  function name     arguments      function name / argument name / argument value
                                      "sqrt"            "x"            "36"
- Argument: one of possibly several expressions that are passed to a function
- Function: an object that evaluate multiple expressions using arguments that are passed to them 
  • You can get help in R by typing ?something into the console.
?range   # get help for range() function