首页 > 解决方案 > xtable在对齐后不隐藏行名或hline

问题描述

一般来说,我是 xtable 和 R 的新手。我有一个 pdf 文档,我想包含一个具有指定列宽的表格。我尝试通过阅读我可以在网上找到的内容来玩一些格式。align但是,在使用该函数设置列宽后,我无法删除行名和 hline 。

ortho <- xtable(orthoInstructions, 
      include.rownames = FALSE, 
      hline.after = NULL)
align(ortho) <- c("p{0.1cm}","p{6cm}",
                "p{16cm}")
print(ortho)

structure(list(Name = c("Aspirin only", "Clopidogrel or other -grels only", 
"Dual Antiplatelet (Aspirin AND Clopidogrel or other -grels)", 
"NSAIDS for pain (e.g. ibuprofen, naproxen, diclofenac)"), PlanNormal = c("Stop 7 days before surgery", 
"Stop 3 to 7 days before surgery (PAC Nurse to advise)", "PAC Nurse to advise (Dual antiplatelets) - discuss with surgeon and anaesthetist", 
"Stop 2 days before surgery")), row.names = c(NA, -4L), class = c("tbl_df", 
"tbl", "data.frame"))

我错过了什么明显的东西吗?

标签: rr-markdownxtable

解决方案


推荐阅读