【发布时间】:2021-10-03 02:58:28
【问题描述】:
*为简化示例而编辑
我正在尝试使用 apa_table() 来包含一份包含排除标准的表格,用于审查论文。我已经在 excel 中制作了表格,但我正在尝试将 Rstudio 和 Rmarkdown 用于我所有的学术写作。
表格在excel中是这样的
| Inclusion | Exclusion | Rationale | |
|---|---|---|---|
| 1. Publication | Peer reviewed Journal | Sources other than peer reviewed journals (i.e. professional publications, grey literature) | To ensure the quality of... |
| 2. Article type | Research/Empirical articles presenting methods and results suitable for analysis and synthesis | Articles describing interventions without presenting research findings (i.e. theraputuc manuals) | To evaluate evidence for a given... |
| 3. Language | Articles published or available in English | Articles unavailable in English | No access to translation service |
| 4. Program type | Program that explicitely target... | Interventions that do not include.... | To ensure the review focuses on... |
我在 python 和网状结构中感觉更舒服,我想我可以将 Pandas 数据框传递给 R 并制作表格,但是当我这样做时,针织文档会显示如下表格:
我也刚刚尝试过使用markdown文本,结果……更接近了
我使用的代码是
df <- data.frame(inclusion <- c('Peer reviewed Journal articles',
'Research/Empirical articles presenting methods and results suitable for analysis and synthesis',
'Articles published or available in English',
'Programs that explicitly include...'),
exclusion <- c('Sources other than peer reviewed journals (i.e. professional publications)',
'Articles describing interventions without presenting research findings (i.e. theraputuc manuals)',
'Articles unavailable in English',
'Interventions that do not include a...'),
rationale <- c('To ensure the quality of included...',
'To evaluate only empirical evidence for a given program/intervention rather than...',
'No access to translation service',
'To ensure the review focuses on the outcomes of hero based interventions')
)
rownames(df) <- c('1. Publication type',
'2. Article type',
'3. Language',
'4. Program type')
colnames(df) <- c('Inclusion', 'Exclusion', 'Rationale')
library(papaja)
apa_table(
df
, caption = "Inclusion/Exclusion Criteria"
, note = NULL
)
我还阅读了this page on the apa_table() arguments 并且没有任何运气。任何帮助将不胜感激。
【问题讨论】:
-
您使用的是 PDF 输出格式吗?如果是这样,您也许可以使用 LaTeX 对齐设置。对于段落对齐,您可能可以使用
p{4cm}或类似的。这里描述了其他可能性:en.wikibooks.org/wiki/LaTeX/Tables#Text_wrapping_in_tables。我会演示,但您没有包含任何可重现的内容... -
我试着像你一样编辑它,这能让你证明你的意思吗?
-
对不起,我看不懂你写的。您应该简化示例:转储所有不相关的 Python 内容,然后在 R 中创建一个数据框,其中包含一些您想要格式化的文本。将所有内容放在一个任何人都可以运行的简单 R Markdown 文档中。
-
我现在已经把它转换成R了,谢谢你的建议。
-
那不是 R Markdown。当我将它放入 R Markdown 文档时,它无法运行。你没有说
apa_table函数来自哪里(我猜是papaja包,但它不在CRAN 上,所以我应该安装哪个版本?),当我从Github 安装一个时,由于缺少LaTeX 而失败环境等。我投票关闭。
标签: r r-markdown papaja