Assignment 2. R preliminaries

Due by 5:00 PM on Thursday, October 1, 2020

To do yourself

To submit on blackboard, due 10-01-2020, 5:00pm

  1. Use the help functions or R documentation to look up a function that you think you will use. Provide (in words) a description of what the function is and does, the arguments that takes, and why you find this function useful. Then, using a sample dataset in R (i.e., mtcars, iris, ToothGrowth), demonstrate (in code) the use of this function.

  2. Create two numeric, two character, and two logical objects/variables in R. Give them descriptive names. Provide code examples.

  3. Use some function that operates on the two numeric objects, another that operates on the two character objects, and another that operates on the two logical objects.

  4. Describe different ways to install R packages. Test each method by installing packages of your choice (e.g., Hmisc, lme4, MASS, dslabs). Install a GitHub package (e.g., jokergoo/ComplexHeatmap)

  5. Describe all ways how to find:

    • Path(s) where R packages are installed
    • Copy-paste selected output and describe your observations
  6. What is unusual about each of the following objects?

num_char     <- c(1, 2, 3, "a")
num_logical  <- c(1, 2, 3, TRUE)
char_logical <- c("a", "b", "c", TRUE)
tricky       <- c(1, 2, 3, "4")
  • Submit your homework as a text or Word document. Files should be named, e.g., LASTNAME-FIRSTNAME-HW02.