-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interval support functions #379
Comments
Hey @billdenney I think this issue was accidentally duplicated, see #378 Also I think that it would be nice to have other optional parameters, specially in |
GitHub was having issues with issues yesterday. Thanks for pointing out the duplication. I closed the other. The way I was thinking this would fix your issue is that you could do something like the following.
... But, as I look at that, it's indirect. Let's implement the above functions as support functions for ones that do more detailed controls. (I prefer smaller, more focused functions as they are easier to maintain.) |
Hello @billdenney thanks! I made already some |
Based on the conversation in #371, we need a set of interval-support functions. Some of the needs are:
The initial interface that I'm thinking of is:
All functions
The
data
input argument can be eitherDrop parameters
interval_remove_param(data, param = NULL, param_pattern = NULL)
param
is a character vector of parameters to removeparam_pattern
is a character vector (can be more than one pattern) of regular expression patterns of parameters to removeOne or both of
param
orparam_pattern
must be given.Sets all parameters matching
param
orparam_pattern
toTRUE
.Add param
It's not clear to me that this is necessary since you can simply set the column to
TRUE
. But, we can include it for completeness of the interface and the fact that it's trivial.interval_add_param(data, param = NULL, param_pattern = NULL)
Arguments are the same as
interval_remove_param()
.Sets all parameters matching
param
orparam_pattern
toFALSE
.Add imputation
interval_add_impute(data, impute, after = Inf)
impute
is the imputation character string to add, matching the behavior ofPKNCAdata()
after
follows similar behavior to theafter
argument ofbase::append()
;0
indicates it will be added as the first imputation method;Inf
(or any number greater than the number of methods currently specified) indicates that it will be added as the last imputation method;If there is already an imputation:
strsplit(current_impute, split = "[, ]")
)after
), andvapply(X = new_impute, FUN = paste, collapse = ",", FUN.VALUE = "")
)Remove imputation
interval_remove_impute(data, impute)
The text was updated successfully, but these errors were encountered: