-
-
Notifications
You must be signed in to change notification settings - Fork 221
Closed
Description
In quite some user-space code the R side has something like
weightedLeastSquares(X, y, w) # ie y ~ X given weights wwhere the third argument is options, ie
weightedLeastSquares(X, y, NULL)In that case we generally cannot have the third strongly typed as NumericMatrix or alike and have to keep it a SEXP in the interface. Nothing wrong with that but a bit of an eyesore.
Following some discussion with @dcdillon I have written a really simple wrapper class Nullable that contains a SEXP as well as a bool for state. With that we can do (stylized)
...., NumericVector & w) {
//...
if (!w.isNull()) {
// do stuff with w
}If there is no protest -- or someone reminds of something much better we already have ;-) -- then I'll fold that in.
Metadata
Metadata
Assignees
Labels
No labels