我正在使用 huxtable 包生成回归结果的 Latex 表。但是,更改列宽不会更改 Latex 表中的列宽。请在下面找到一个可重现的示例。
data(diamonds, package = "ggplot2")
diamonds <- diamonds[1:100,]
列宽为 C(2,2,2)
huxreg("Reression 1" = lm(price ~ carat + depth, diamonds),
error_pos = "right", number_format = 2,
note = "{stars}. Standard errors in brackets. Base Year is 2002.",
statistics = c(N = "nobs", R2 = "r.squared")) %>%
set_bold(row = 3, col = 1) %>%
set_col_width(c(2,2,2)) %>%
print_latex()
列宽为 C(1,0.5,0.5)
huxreg("Reression2" = lm(price ~ carat + depth, diamonds),
error_pos = "right", number_format = 2,
note = "{stars}. Standard errors in brackets. Base Year is 2002.",
statistics = c(N = "nobs", R2 = "r.squared")) %>%
set_bold(row = 3, col = 1) %>%
set_col_width(c(1,0.5, 0.5)) %>%
print_latex()