Create extractPeaks.R

Create a function that extract peaks from a variable