Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Reading Assignments Textbook chapters 1* 2, and 3; \'An Introduction to R\' (fro

ID: 3665986 • Letter: R

Question

Reading Assignments Textbook chapters 1* 2, and 3; 'An Introduction to R' (from the R manuais located in the R help menu) pp. 1-32. Submitted Assignment: Problems related to Chapter 1 and 2:Tins assignment serves as practice for the material we have covered in class and in your assigned readings regarding chapters 1 and 2 of the text. Below are several questions to answer by typing the correct syntax directly into the R console (as we have been doing in class). When you have finished, access the "File" pull-down menu and select "Save to File..to save the entire R console as a text file called "Assignment l.R" preceded with your first initial and last name: i.e., "SHAYS Assignmentl.txt". Upload this to Blackboard by 2:00 pm Monday 2/08/2016. No other submission method will be accepted, nor will any late assignments.If you perform the assignment in multiple R sessions, save the console window each tune and merge these files as necessary so that only a single text file is submitted. I will non your code and you will be graded on whether the code runs without error, whether the answers are correct, and if proper commenting of your code (use of #) exists in your file.You will find there are numerous different syntax sequences to write code that all arrive at die exact, correct, and same answer as some other method. Tins is OK, any correct answer receives full credit: whether it took 20 lines to do so or a single function. These distinctions will become talking points for our lectures.For die remainder of die assignment, comment your code when necessary using die # convention. At die very least, use die # comment syntax to indicate winch part of winch problem is being answered in order to receive full credit.

Explanation / Answer

Text followed by > symbol are R commands

1)Access the ISwR library

>#installing the ISwR package for ques 1)

> install.packages('ISwR')

>#loading the package to access the ISwR library

> library(ISwR)

2)

a)

>#Solution for part a) of ques 2)

> a=abs(-2)-abs(-3)

b)

>#For part b) of ques 2)

> b=log2(15)

c)

>#for part c) of ques 2)

> c=sqrt(tan(pi/4)/exp(2))

d)

>#for part d) of ques 2)

> d=1/sin(pi/2)

e)

>#for part e) of ques 2)

> b=asin(1)

f)

>#Forming a vector of all results for part f) of ques 2)

> results=c(a,b,c,d,e)

g)

>#forming a vector that repeats the vector results four times for part g) of ques 2)

> results_g=c(results,results,results,results)

h)

> #forming a vector for part h) of ques 2) in which results of part a) is repeated twice, part b) four >#times and rest are repeated thrice.

> results_h=c(a,a,b,b,b,b,c,c,c,d,d,d,e,e,e)