You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new addNA function (see #12) adds an interesting functionality, but I'm not sure it's a good way to implement it because :
it overrides a base function, which I'm not very happy with
this overriding generates a warning each time questionr is loaded
it duplicates the code of the base function
So I wonder if it would not be better, instead of overriding and adding an argument to addNA, to create a new addNAstr function (or whatever better name we could find) which would be something like (not tested) :
addNAstr <- function(..., value=NULL) {
x <- addNA(...)
s <- ifelse(is.character(value), value, "NA")
levels(x)[is.na(levels(x))] <- s
x
}
What do you think ?
The text was updated successfully, but these errors were encountered:
In fact, I'm currently fighting with the fact that one of the imported package in questionr is overriding another base function (see #19), so I would be very inclined not to do it. But I'm not objective at all right now :-)
In fact, I'm currently fighting with the fact that one of the imported
package in questionr is overriding another base function (see #19#19),
so I would be very inclined not to do it. But I'm not objective at all
right now :-)
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/18#issuecomment-27972105
.
The new
addNA
function (see #12) adds an interesting functionality, but I'm not sure it's a good way to implement it because :base
function, which I'm not very happy withquestionr
is loadedbase
functionSo I wonder if it would not be better, instead of overriding and adding an argument to
addNA
, to create a newaddNAstr
function (or whatever better name we could find) which would be something like (not tested) :What do you think ?
The text was updated successfully, but these errors were encountered: