--- title: "Assignment 1" subtitle: CRD 150 author: YOUR FULL NAME HERE date: INSERT DATE HERE output: html_document: theme: cosmo --- ```{r setup, include=FALSE} # Do not edit this code block/chunk knitr::opts_chunk$set(echo = TRUE, warning=FALSE, message = FALSE) knitr::opts_knit$set(progress = TRUE, verbose = TRUE) ``` 1. Look up the help documentation for the function `rep()`. Use this function to create the following 3 vectors. a. [1] 0 0 0 0 0 ```{r} #Insert your code here. Remember to include comments on what your code is doing. ``` b. [1] 1 2 3 1 2 3 1 2 3 1 2 3 ```{r} #Insert your code here. Remember to include comments on what your code is doing. ``` c. [1] 4 5 5 6 6 6 ```{r} #Insert your code here. Remember to include comments on what your code is doing. ``` 2. Load the *mtcars* dataset by using the code `data(mtcars)`. What are the units of observation? How many unit of observations does this dataset have? How many variables? Remember that wherever possible, you will need to use R code to answer the questions. The dataset's help documentation `? mtcars` might be useful. ```{r} #Insert your code here. Remember to include comments on what your code is doing. ``` 3. Explain what is the problem in each line of code below. Fix the code so it will run properly. a. my variable <- 3 ```{r} #Insert your code here. Remember to include comments on what your code is doing. ``` b. seq(1, 10 by = 2) ```{r} #Insert your code here. Remember to include comments on what your code is doing. ``` c. Class(c(1,2,3)) ```{r} #Insert your code here. Remember to include comments on what your code is doing. ``` 4. Have you ever used R before? If so, to what extent? Have you used any of the following programs: Excel, SPSS, Stata, SAS, Python, Matlab? If so, to what extent? For each program, choose one of the following options: (a) Never used, (b) Beginner, (c) Basic competence, (d) Intermediate, (e) Advanced. 5. Describe what you are hoping to get out of this class?