O'Reilly logo

R Statistical Application Development by Example Beginner's Guide by Prabhanjan Narayanachar Tattar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – smoothening the cow temperature data

First we use the smooth function from the stats package on the cow temperature dataset. Next; we will use the han function from LearnEDA.

  1. Load the cow temperature data in R by data(CT).
  2. Plot the time series data using the plot.ts function: plot.ts(CT$Temperature,col="red",pch=1).
  3. Create a 3RSS object for the cow temperature data using the smooth function and the kind option: CT_3RSS <- smooth(CT$Temperature,kind="3RSS").
  4. Han the preceding 3RSS object using the han function from the LearnEDA package: CT_3RSSH <- han(smooth(CT$Temperature,kind="3RSS")).
  5. Impose a line of the 3RSS data points with lines.ts(CT_3RSS,col="blue",pch=2).
  6. Impose a line of the hanned 3RSS data points with lines.ts(CT_3RSSH,col="green",pch=3) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required