It is important to select the bandwidth carefully. Too large a bandwidth will wash out details as it averages over the whole data set. Too small a bandwidth may create artificial details in the smoothed data.
3. Call the ksmooth function to perform kernel smoothing on the data set.