Question: Directions: For each homework assignment, submit one .pdf file with two components: 1. The direct numerical or written answer of the questions. No codes included.


Directions: For each homework assignment, submit one .pdf file with two components: 1. The direct numerical or written answer of the questions. No codes included. 2. A R script (.R file) converted to .pdf with all the code you have used for the assignment. Use comments to mark the question number and comments. 3. Merge these two parts together in a single file. 1. Perform the following tasks in R: (a) Define objects x = 2 and y = 6, calculate In(x+y) and log3(xy/3) (b) Google the function in R to get a random sample of size 20 with replacement from 1:100. Define it as vector sample, and calculate the square root of all the elements in the sample. 2. Create a vector of a sequence from 102 to 351. (a) Define a new data with the 18th, 29th, 32nd, 44th, 87th elements from the original data set. (b) Find all the numbers in the original data set divisible by 6 also 9. (c) Get a random sample of size 15 without replacement from the original data. 3. Why does the following function doesn't work? (Hint: look closely!) my_variable Error in eval(expr, envir, enclos): object 'my_variable' not found 4. Create the vector Vecl Error in eval(expr, envir, enclos): object 'my_variable' not found 4. Create the vector Vecl
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
