The monotone package contains a fast up-and-down-blocks implementation for the pool-adjacent-violators algorithm for simple linear ordered monotone regression, including two spin-off functions for unimodal and bivariate monotone regression (see <doi:10.18637/jss.v102.c01>).
copied from cf-staging / r-monotone