1

我正在尝试使用包 expss,并且我遵循了一些示例,但是我的表很大。如何调整表格以使其变小,如链接中的?

链接中的表格见:expss介绍

我的表格有很大的边距:

在此处输入图像描述

我想我需要对设置进行更改,但我不知道如何。我的设置是:

library(knitr)
knitr::opts_chunk$set(echo = TRUE)
4

1 回答 1

0

尝试使用htmlTable css.cell参数:

library(expss)
data(mtcars)
mtcars = apply_labels(mtcars,
                      mpg = "Miles/(US) gallon",
                      cyl = "Number of cylinders",
                      disp = "Displacement (cu.in.)",
                      hp = "Gross horsepower",
                      drat = "Rear axle ratio",
                      wt = "Weight (1000 lbs)",
                      qsec = "1/4 mile time",
                      vs = "Engine",
                      vs = c("V-engine" = 0,
                             "Straight engine" = 1),
                      am = "Transmission",
                      am = c("Automatic" = 0,
                             "Manual"=1),
                      gear = "Number of forward gears",
                      carb = "Number of carburetors"
)


cro(mtcars$am, mtcars$vs) %>% 
    htmlTable(css.cell = "padding: 0px;")
于 2019-03-05T11:17:42.170 回答