-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
text_short() etc. and current API thoughts? #153
Comments
text_short was rather deprecated in favour of the summary() generic One nice API in theory would be to have report() and then pipe it to Basically, one of the issue with So currently we split the reports into several submodules (report_parameters, report_intercept, report_performance, etc.) [that we also export] which seem to make sense for a lot of models and share a lot of commonalities, but once the main One possibility would be to drop the summarized version altogether, but I realized (early on) when using proto-versions of reports that in my own work for instance if I have several similar models, having all the full info for all of them made the files super verbose and not digest with a lot of redundant info, so it was nice to have like one time the full model and then just the critical information (although I agree that what is "critical" is highly debatable)
|
The pkgdown site still has these functions documented: https://easystats.github.io/report/reference/text_long.html |
This comment has been minimized.
This comment has been minimized.
I'm wondering what the purpose of storing static So, for example: format_report_coefficient <- function(rr, digits = 3, down_with_nhst = FALSE) {
if (down_with_nhst) {
rr$interpret_significance <- NA
rr$p_value <- NA
}
with(
rr,
glue::glue(
"The effect of {term} was",
if (!is.na(interpret_significance)) " {interpret_significance}" else "",
if (all(!is.na(interpret_significance), !is.na(interpret_es))) " and" else "",
if (!is.na(interpret_es)) " {interpret_es}" else "",
" (β = {format(es, digits = digits)}",
if (!is.na(ci)) ", [{ci}% CI {format(ci_low, digits = digits)}, {format(ci_high, digits = digits)}]" else "",
if (!is.na(p_value)) ", p = {format(p_value, digits = digits)}" else "",
")",
"."
)
)
}
rr <- list(term = "predictor", interpret_significance = "statistically significant", interpret_es = "large", es = .90, ci = 99, ci_low = .85, ci_high = .95, p_value = .001)
format_report_coefficient(rr)
# The effect of predictor was statistically significant and large (ß = 0.9, [99% CI 0.85, 0.95], p = 0.001).
format_report_coefficient(rr, down_with_nhst = TRUE)
# The effect of predictor was large (ß = 0.9, [99% CI 0.85, 0.95]). Here, the idea is that (Using |
Other formatting bits could include things like localization (e.g., US English "we fit a model" vs UK English "we fitted a model", perhaps eventually non-English translation). |
That seems like a good idea, we could start experimenting/implementing such increased modularity little-by-little, starting in places where it's easy and "stable"? though we might want to keep not having "glue" as a dependency (or we add it, after all, report does some heavy gluing throughout... @strengejacke ?). Also, I don't think we'll be able to have ß symbols, since CRAN only allows ASCII symbols in the package (hence that discussion #97 and my proposal to spell out the symbol as |
Although glue has no further dependencies, I don't see the benefit, i.e. if using glue outweigh potential issues. I always have the example of "withr" and "rstanarm" in mind, which totally broke the package. Unless we really need specific functions, I'd say we stick to base R functions. |
Yes, I think so, too. I'm not sure if |
The way to use the beta symbol is to Unicode escape it. |
I'm worried that it will introduce a lot of |
If the printing environment can’t support unicode (such as R GUI on Windows with a US code page), it prints fallback characters, which for Greek letters are English characters (b, etc). There are some tests we could run to check the environment and unicode support, but they probably aren’t necessary. If report is going to be used in, for example, latex or markdown report generation, it really needs to be able to include correct character formatting. |
cool! Indeed we should test it a bit first but otherwise it seems like a good idea |
It's not exactly clear to me what the current status of
text_short()
etc. are. They still appear in the pkgdown site, but are commented out in various places in the source. Has that API been abandoned?One API thought I had looking at the various functions is that
format()
might be a good generic to use here because it is so extensible. Table/text/numbers only, as well as choosing specific parameters or quantities could controlled with arguments. Not saying to discard other existing approaches, but might be useful in lieu of an ever expanding list of specific functions?The text was updated successfully, but these errors were encountered: