bulk change to the R interface, along with tests