-
Notifications
You must be signed in to change notification settings - Fork 2
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
Dilernia tables patch #54
Conversation
Fixes column width issues when knitting to Word and possible mistake in digits argument to finalize_tbl
Hey! Thank you for this! Do you know if this is a widespread issue across all tables or just those in the files you edited here? I ask because I wonder if your edits would be better placed in
at the very end but I wonder if it's not working due to the caption being the last step rather than before the auto fitting, if that makes sense. Based on your testing, would it make more sense to convert your edits here into
and put it in the |
I believe it was all tables that have wide enough columns when knitting to
Word (I reproduced the issue with a couple data sets).
Updating the finalize_tbl() function would be the most efficient route I
think. I actually tried going this route in my forked repo of gvsu215
because I suspect that is right - setting the caption could be undoing the
fitting of the table. I can't remember where exactly, but updating
the finalize_tbl() function in this way seemed to cause separate issues to
pop-up when I updated it throughout the package, so I patched the functions
that output tables. Whatever solution you find works easiest is great
though!
Andrew
…On Fri, Aug 23, 2024, 12:09 PM Ian Curtis ***@***.***> wrote:
Hey! Thank you for this!
Do you know if this is a widespread issue across all tables or just those
in the files you edited here? I ask because I wonder if your edits would be
better placed in R/utils.R in the finalize_tbl() function. The function
currently runs
...
flextable::autofit() %>%
flextable::fit_to_width(6) %>%
flextable::set_caption(...)
at the very end but I wonder if it's not working due to the caption being
the last step rather than before the auto fitting, if that makes sense.
Based on your testing, would it make more sense to convert your edits here
into
...
flextable::set_caption(...) %>%
flextable::autofit() %>%
flextable::fit_to_width(6) # or 7.5
and put it in the finalize_tbl() function?
—
Reply to this email directly, view it on GitHub
<#54 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFZMXGJZEW3UNWX52OAJO6LZS5NB7AVCNFSM6AAAAABMPGMIHOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBXGM4DQMJZGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
After some testing, I believe the issue some from |
Sounds good, thanks Ian! If you'd like to chat about anything or have me
test anything out feel free to let me know.
Andrew
…On Mon, Aug 26, 2024 at 1:48 PM Ian Curtis ***@***.***> wrote:
Merged #54 <#54> into main.
—
Reply to this email directly, view it on GitHub
<#54 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFZMXGJKICIOLYA5F3UOL53ZTNS5PAVCNFSM6AAAAABMPGMIHOVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJUGAYTMOBYGA2DSNY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Patched the functions producing flextable objects to fix column width issue when knitting to Word. Did so by adding autofit() and fit_to_width() calls at the end of the functions that return flextable objects. This adds redundancy to the code, but minimized / prevented changes to the other functions in the package.