piecewise linear model in R