As submitted to CRAN