MAT 5335 Project 1 due Friday 20 January Directions: Use R to answer the following questions. Will be updates to include a few more problems. Last updated 10-11-17. 1. R has built in data sets, to see the list type: data(). Consider the data set AirPassengers. Type: ?AirPassengers to see a description. Which year had the most passengers? What Month/Year had over 500? How many? 2. Questions 1-4 from 'On Your Own' : http://htmlpreview.github.io/?https://github.com/andrewpbray/oiLabs-base-R/blob/master/intro_to_r/intro_to_r.html 3. Find the Taylor series of f(x)=e^x at zero. Use R to approximate f(1) by finding the sum of the first six terms. What is the error? 4. Consider the built in data set presidents, which contains approval ratings of US presidents. (a) What do the following commands tell you? Some of them should give you an error or NA. mean(), sd(), length(), sort(), cumsum(), summary() (b) In the mean and sd functions, include the statement na.rm=TRUE. Now what outputs do you get? (c) You can also express your data as a vector. You can do this by typing: prez=as.vector(presidents). Now find the mean and standard deviation. What happens? 5.(a) What is the difference between NA and ''NA''? (b) Construct a vector, call it vec, of length 10, with numbers and characters. (c) We learned how to append elements to a vector. Append NA and ''NA'' anywhere in your vector. (d) Now lets remove NA. Write a function that returns the location of the first occurrence of NA. Hint: which and is.na may be helpful. Hint: What happens if you type vec[-3]? vec[-15]?