HW1_Questions.pdf - Homework 1 MSA 401 R Programming Professor Peter Rossi Instructions Please turn in 1 PDF document as your homework submission

# HW1_Questions.pdf - Homework 1 MSA 401 R Programming...

• Homework Help
• 2

This preview shows page 1 - 2 out of 2 pages.

Homework 1 MSA 401 - R Programming Professor Peter Rossi Instructions Please turn in 1 PDF document as your homework submission. Answers that require R code should clearly display the code and its output (i.e., what it returns). For example: Example Question: Find the current date and time Example Answer: Sys.time () ##  "2018-09-10 12:14:11 PDT" Question 11a) Generate the sequence{-10,-9,· · ·,10}using theseq()function.1b) Generate the sequence{12,22,· · ·,102}.1c) What are the sums of the sequences given in parts (1a) and (1b) above?1d) What are the cumulative sums of the sequences given in parts (1a) and (1b) above?Question 2Consider two vectors,vec1andvec2. Provide two ways of finding the sum of the lengths of the two vectors.Question 3InR, zero divided by zero is not defined.Rhas a data type calledNaN(not a number) which can be usedwhen a numerical expression is not defined.3a) Provide another example of how aNaNcan be generated. (Hint: you might want to useInf, the built insymbol for infinity.)3b) What is difference between  • • • 