Santiago Barreda
Assistant Professor, Department of Linguistics, UC Davis

Main Research Vignettes CV phonTools Statistics Links

 


interpolate [phonTools]

 

This function performs a linear or 'natural' cubic spline interpolation between given points. In the example below, linear (red line) and cubic (black line) spline interpolations have been performed between 10 randomly generated points.

 

 

Code used to generate examples:


library (phonTools) ## generate ten random points y = rnorm (10, 0, 5) cubic = interpolate (y) ## perform a cubic interpolation linear = interpolate (y, type = 'linear') ## perform a linear interpolation ## and compare the two plot (y, pch = 16, cex = 2) lines (cubic, col = 1, lwd = 1) lines (linear, col = 2, lty = 'dotted', lwd = 2)