please help me to write R script for this problem. i will add csv file myself
- (3 marks) Read the "assignment1.csv" file and Save it as a dataframe named "CerealsDF" Display the structure of "CerealsDF" using str() function and examine the variables and their classes Display the first ten rows of "CerealsDF" - ( 3 marks) The second line in "CerealsDF" represents the data type of each column. Delete this line from the dataframe Print the number of rows and columns in the data frame Add a new column named "totalcarbo" that shows the total of both carbo and sugars columns - (3 marks) The "type" column shows the type, i.e., hot or cold, of the cereal and "mfr" column shows the manufacturer of the cereal. Find how many cereals are hot. Use subset() function Find how many unique manufacturers are mentioned in the dataframe. Use unique() function Extract all cereals that are manufactured by Kellogg's ("K"). Call this dataframe as "cereals_ K " and print it - (3 marks) To examine the total value of each type, we need to look at the values of two or more columns. - Extract all cereals that have less than or equal 90 calories AND have more than 2 units of fat - Save this subset as a CSV file on your desk. Use wirte.csv() function Task II: Vectors, Functions, Series ( 12 marks) You are given the following discrete data that represent the following function: f(x)=cos0.5xe0.1x - Write an R function that implement the Interpolation formula shown in the class. Call this function MyIntCal(). - What is degree of the interpolating function? - You should have seven Lagrange polynomials, L1, L2, ... L7. Create a 4x2 figure and plot each of these polynomials in one subfigure. Add the final interpolating function in the last subfigure. Save this figure as MyintFig.pdf - Use the built in function poly.calc() to find the interpolating function and call it pf_x. - Find the value of f(15) using MyintCal() and pf_ x. - Find the value of f(24) using MyintCal() and \( p f_{\text {_ }} \)