Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

please help me to write R script for this problem. i will add csv file myself image text in transcribed
image text in transcribed
- (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 {_ }} \)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Power Bi And Azure Integrating Cloud Analytics For Scalable Solutions

Authors: Kiet Huynh

1st Edition

B0CMHKB85L, 979-8868959943

More Books

Students also viewed these Databases questions

Question

Discuss the characteristics of emerging adulthood.

Answered: 1 week ago