Conversation
…o made test for combine mrs
R/combine-arrays.R
Outdated
There was a problem hiding this comment.
I think you need to eliminate this space and run make doc again. I suspect this is why you don't have an entry in your NAMESPACE file for these functions.
There was a problem hiding this comment.
You can delete these 6 lines. The three lines below do this more robustly.
There was a problem hiding this comment.
If I read the tests for this correctly, the purpose of this function is to take the subvariables from two or more MR variables and make a single MR from them--is that right? If so, how about we keep the first MR, unbind the rest, and use addSubvariables to add them to the first? Like:
combineMRs <- function (variable, ...) {
newsubvars <- unlist(lapply(list(...), unbind)) ## unbind returns the URLs of the unbound variables
return(addSubvariables(variable, newsubvars))
}
addSubvariables would need to take more than just one subvar, and it would need to accept URLs, but neither are too challenging (and they're more generally useful in that function itself too). And also this way, you wouldn't need separate functions to add to categorical arrays and multiple responses--same function would work.
I haven't made tests for combineArrays but to be honest I'm not sure anyone else would ever want/need that function