Use `stopifnot()` or the `assertthat` package to check that inputs are the expected classes. Follow up to #406
Use
stopifnot()or theassertthatpackage to check that inputs are the expected classes. Follow up to #406