Various minor roxygen/package structure/vignette suggestions.#39
Various minor roxygen/package structure/vignette suggestions.#39kenkellner merged 14 commits intomasterfrom
Conversation
|
Thanks for the review! A few initial responses to some of your points:
Good point, actually this is one of those things that the check will not catch because the function is inside a list.
Fine with me to change it. It's not an argument that's likely to get used a lot so I don't think the length matters that much.
I think we had this idea previously and went with
I had it in my head that the formula handlers needed to be exported based on the way |
Thinking about this more, I wonder if we actually should not have roxygen entries for modelInfo and .env. They are arguments to the macro function, but they are used only internally by nimble to pass information and will never be used by the user. So, should we take advantage of the fact that R CMD check will not actually cross-check the arguments of the macros (because they're inside a list) and leave the arguments out to avoid confusing users? |
|
Regarding |
|
A few more comments based on looking through the test files. I didn't look exhaustively, but I did try to use the tests to see if I could come up with corner cases.
|
|
Definitely changing:
Proposed changes:
Change must be done in
|
This is (in my understanding) what y <- rnorm(1000)
x <- factor(sample(letters[1:3], 1000, replace=T))
w <- factor(sample(letters[4:6], 1000, replace=T))
dat <- data.frame(y=y, x=x,w=w)
library(lme4)
lmod <- lmer(y~1 + (1|w/x), data=dat)
summary(lmod)ranef(lmod)Here's the equivalent library(nimbleMacros)
nimbleOptions(enableMacroComments=FALSE)
code <- nimbleCode({
LM(y ~ 1 + (1|w/x))
})
mod <- nimbleModel(code, constants=as.data.frame(dat))
mod$getCode() |
I added (ii), but (i) must be error trapped in |
|
Ok, for (i) can you put a PR into nimble when you have a chance? |
|
PR is here. |
@kenkellner I've looked through the vignette, Roxygen, and package structure files and made various (mostly nit-picky) suggestions in this PR. I don't think anything will be controversial, but feel free to modify those you don't like.
Other things of note:
LINPREDroxygen, I am thinking thecenteringargument could be better explained.modelInfoand.envargs for some of the functions inLINPRED.R. I'm sureR CMD checkwill catch any other such cases.modMatNames. I'd vote formodelMatrixNamesdespite its length. But then I also wrote a >200 page thesis, so you might take that with a grain of salt. Perhaps @danielturek can vote my suggestion up or down.etavalue should be 1 to get uniformity over correlation matrices. The 1.3 in the manual is arbitrary, and this now has me wondering if we should change that...priorsrather thanpriorSpecs.LINPRED_PRIORSsection, I think we could make more clear that the user would often not need to callLINPRED_PRIORSdirectly. TheLINPREDsection is prefaced with a comment along these lines that could be repeated for theLINPRED_PRIORSsection.formulaHandlerfunctions all have basically the same roxygen and these are not user-facing anyway. I suggest a single roxygen block with the use of@aliasso that all of them refer to the same roxygen.I have on my todo list to take a bit more time and look at the tests and try to think of corner cases. I hope to do that by end of next week.
As far as code review, I suspect I will not have time to take a thorough look.