-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Formatting issue with print_md() applied to compare_parameters() #887
Comments
Yes, this started as an experimental feature, because I tested the tinytable package as alternative. Thus, some functions now support different engines for printing to HTML or MD. Use the |
* Formatting issue with print_md() applied to compare_parameters() Fixes easystats/insight#887 * docs * docs * docs * dont use remotes * lintr, docs * docs * fix
Just a question: which output is not correct in which context? |
For my purposes at least, the second version (compare_performance's) is much better. |
But the rendered file looks ok? Or do you have in general problems with markdown rendering for |
@vincentarelbundock Do you know why the table is not correctly rendered in R notebooks on preview when using tinytable for markdown tables? See screenshot: Rendering works well for the final compiled notebook/HTML, but not for the preview inside RStudio. |
Not sure. What tinytable commanda do you use internally? |
# create base table
out <- tinytable::tt(formatted_table, notes = footer, caption = caption)
# insert sub header rows and column spans, if we have them
if (!(is.null(row_groups) && is.null(col_groups))) {
out <- tinytable::group_tt(out, i = row_groups, j = col_groups)
}
out@output <- outformat
out Export function code starts here. |
|
At the end of this function, it looks like you are overriding the output format determined by |
You should not manually override the table format. Forcing rendering to go through markdown may work for simple tables, but it disables a lot of features like colors and styles. So your tables are not as flexible as they could be. Rendering HTML tables inside a notebook preview should be handled upstream. I opened an issue here: vincentarelbundock/tinytable#282 I'll have to look into it, because I'm not quite sure how these previews are handled by RStudio. Should I just return HTML? How can I distinguish cases where a user wants to embed in the preview or wants to run on the console and print to the viewer? I'm completely overwhelmed with work now, so might not get to this super quickly, unfortunately. |
I know, but that's intentional. We have The reason why we override the output format is because else we could not create HTML tables with tinytable from interactive/console, when it's requested (via |
I think it's not high priority, because we can use |
cool cool. Let's leave this open, because it would be very nice to have proper display in notebooks. I'll circle back to this when I have time to investigate. |
The formatting for
print_md()
applied tocompare_parameters()
differs from that when applied tocompare_performance()
. As a result, the former is not displaying properly in interactive mode in RStudio.Comparison of Model Performance Indices
Created on 2024-06-10 with reprex v2.1.0
The text was updated successfully, but these errors were encountered: