Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help me writing R script for these two task.. help me with the code... i will insert csv file myself - (3 marks) Read

please help me writing R script for these two task.. help me with the code... i will insert 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 - S 3 marks) The "type" column shows the type, i.e., hot or cold, of the cereal and "mfs" 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 equalig0, 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 42 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 pfx

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_2

Step: 3

blur-text-image_3

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

Database Systems For Advanced Applications 15th International Conference Dasfaa 2010 International Workshops Gdm Benchmarx Mcis Snsmw Diew Udm Tsukuba Japan April 2010 Revised Selected Papers Lncs 6193

Authors: Masatoshi Yoshikawa ,Xiaofeng Meng ,Takayuki Yumoto ,Qiang Ma ,Lifeng Sun ,Chiemi Watanabe

2010th Edition

3642145884, 978-3642145889

More Books

Students also viewed these Databases questions

Question

2. What would you do first if you were Jennifer?

Answered: 1 week ago