Closed gestauffer closed 5 years ago
The following works for me:
test = data.frame(var1=1918:1925,var2=c(9009,1000:1006),var3 = 1100:1107)
HUX <- hux(test)
HUX = set_col_width(HUX, 1:3, c(0.6,0.2,0.2))
quick_pdf(HUX)
Could you provide a MWE and report your platform details, including whether the tinytex package is installed?
Hmm, it works for me now as well. I thought that the issue cropped up with wrap(HUX) = TRUE
, but that doesn't create a problem now. And the code below works as well (that was my MWE).
library(dplyr)
library(huxtable)
test=data.frame(var1=1918:1925,var2=c(9009,1000:1006),var3 = 1100:1107)
HUX <- hux(test)
# add caption, borders, and colnames
HUX <- set_caption(HUX,"Example table") %>%
set_caption_pos("topleft") %>%
set_top_border(1,,1) %>%
set_bottom_border(final(1), , 1) %>%
set_align(,,"left") %>%
add_colnames()
#set width
HUX <- set_width(HUX,1) %>%
set_wrap(,,TRUE) %>%
set_col_width(1:3, c(0.6,0.2,0.2))
quick_pdf(HUX)
My platform is Win 10, R 3.5.0 (I can't update right now for institutional reasons). The tinytex
package is installed.
Heh. Reopen if you manage to reproduce!
When I try to export a table with
quick_pdf()
, after using numeric values to specify column width, e,g.,set_col_width(1:3, c(0.6,0.2,0.2))
the export fails and produces an error:This error is not produced when knitting out of
rmarkdown
.For more detail, see my post at: https://stackoverflow.com/questions/55833023/confusion-about-setting-column-width-in-huxtable/55852144?noredirect=1#comment98442440_55852144