Reimplementations of functions introduced since R 3.0

WWW: https://backports.r-lib.org
