Creating a smoothed dataframe with predict(smooth.pspline) in R

177 views Asked by At

I am working with raw sequencing data, and I want to smooth it using a cubic spline with smoothing parameter 10^-16. I want to create a data frame with the smoothed data using predict(smooth.pspline(parameters)) but I am not sure what parameters to put in the pspline function that will do what I want, since x has to be ascending. If I am working with a very large dataset (stored in df called "ipavg") that follows this format:

Chromosome      Location      Timing
1               33985         -4.402
1               11749         -0.4502
...
13              189184        0.2031
...

The issue is that I don't know how to put x and y values into the parameter since it needs to be in ascending order and the values here for "Timing" go up and down (with many peaks and dips). How do I smooth ipavg using pspline with smoothing parameter 10^-16 and put the predicted smoothed values into a new data frame (that can later be graphed) of the same format? Any help is appreciated! Thank you.

0

There are 0 answers