Assignment 2. R preliminaries
To do yourself
- Install swirl R package
- Install and run the R Programming course
- Explore other swirl courses
- Download IntroR code, create a project in the code’s repository, run through the Intro_R_workshop.R code
To submit on blackboard, due 10-01-2020, 5:00pm
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.Create two numeric, two character, and two logical objects/variables in R. Give them descriptive names. Provide code examples.
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.
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
)Describe all ways how to find:
- Path(s) where R packages are installed
- Copy-paste selected output and describe your observations
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
.