我正在使用R,knitr和pander,我找不到允许我在带有pander的桌子上打印网格的选项.我试过了 :
pander(tableToPrint, style='grid')
Run Code Online (Sandbox Code Playgroud)
但它没有做任何事情,无论是使用此选项还是使用'multiline','rmarkdown'......我总是得到一条水平线,然后是列名,另一条水平线,我的所有数据和一条水平线.我想在每一行之间有一条水平线.另一种选择是交替行颜色.
尝试使用自定义mystyles.sty文件从RStudio编织为pdf.这曾经工作正常,但现在我已升级到RStudio 1.044我得到一个错误.
例:
---
title: "Test"
output:
pdf_document:
includes:
in_header: mystyles.sty
---
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk …Run Code Online (Sandbox Code Playgroud) 我使用ztable,xtable或htmlTable包成功生成表,没有任何问题.但是,我想知道这些表是否可以作为pdf文档输出.当我尝试编织pdf_output时,不会显示该表.相反,信息显示为多个字符串.我试过改变乳胶引擎(使用ztable)和其他方法没有运气.
我看过这里:http:
//www.mzan.com/article/29773068-rmarkdown-latex-table-output-difficulties.shtml
我也看过小插曲等
示例(RMarkdown):
---
output: pdf_document
---
```{r, message = F, results = 'asis'}
# will throw out Error: pandoc document conversion failed with error 43
library(ztable)
data(iris)
options(ztable.type="latex")
zt <- ztable(iris[1:5,], caption = "ztable")
zt <- addcgroup(zt,
cgroup = c("group 1", "group 2"),
n.cgroup = c(2,3))
print(zt)
```
```{r, message = F }
# since it's html, will produce text only
library(htmlTable)
data(mtcars)
colnames(mtcars) <- NULL
htmlTable(mtcars[1:5,], caption = "htmlTable",
cgroup = c("group 1", "group …Run Code Online (Sandbox Code Playgroud) 我想使用 ggplot 将两个变量相互绘制。稍后我想使用非线性拟合,但我遇到了一个我不完全理解的错误消息的问题。我可以看到其他人也有类似的问题,但我可能不够聪明,无法理解答案
我有一个包含 4 个变量的数据集 ost。数据集中没有NA。
使用 ggplot2 我想用回归线绘制数据。为简单起见,我从简单的线性回归开始
library(ggplot2)
qt_int <- c(404, 402, 426, 392, 418, 410)
rr <- c(1000, 958, 982, 752, 824, 844)
gender <- c('male','female','female','female','female','female')
deltnr <- c(10445, 1022, 9122, 60, 246, 306)
df = data.frame(deltnr, gender, qt_int, rr)
p <- ggplot(df, aes(rr, qt_int))
p <- p + geom_point (size = 2)
p <- p + stat_smooth(method = "lm", formula = qt_int ~ rr)
p
Run Code Online (Sandbox Code Playgroud)
我收到以下警告消息:
警告消息:1:'newdata' 有 80 行,但发现的变量有 6702 行 2:计算失败
stat_smooth():arguter …
我正在使用 pandoc v 1.18 我想添加页眉和页脚文本。
我想要完全控制意味着我想将加热器文本放置在左侧、中间和中间,并且与页脚相同。
但我连一个地方都找不到。
我的降价文件中的 YAML 标头中有以下内容
---
header: This is fancy
footer: So is this
headertext: This is fancy
footertext: So is this
#abstract: This is a pandoc test . . .
documentclass: report
output:
pdf_document:
fontsize: 12pt
mainfont: Roboto
geometry: [top=2cm, bottom=1.5cm, left=1cm, right=1cm]
css : pandoc.css
linkcolor : cyan
toc : true
---
Run Code Online (Sandbox Code Playgroud)
我也尝试过单独使用header和headertext,但效果不佳。
我在 RStudio 中使用 ioslides (rmarkdwon) 从 R 创建演示文稿。我想添加徽标,但仅添加到呈现此信息的第一张幻灯片(主):
---
title: "Presentation"
author: "Tom Hanks"
output: ioslides_presentation
logo: logo.jpg
---
Run Code Online (Sandbox Code Playgroud)
我不希望每张幻灯片的左下角都有徽标。谁能告诉我怎么关掉?
我有一个问题,导致书目覆盖多个页面,因为只有第一个使用RMarkdown和Beamer输出打印。
相同的问题已发布在http://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html#comment-2398115545,但没有任何帮助。
---
title: "Sample Document"
output: beamer_presentation
bibliography: bibliography.bib
---
Run Code Online (Sandbox Code Playgroud) 在RStudio中,每当我创建一个新的Markdown时,它总是有默认代码.我该如何删除它?
这是显示的代码.
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r …Run Code Online (Sandbox Code Playgroud) 我试图用 Rmarkdown 做一个非常简单的演示,不涉及任何块。我想要很多文字,所以没有打印出来,因为它们是禁区。
是不是有一个选项,beamer 会设置文本的大小,以便所有文本都可见,或者至少是一种手动缩小文本的快速方法?
我有一个带有观察结果的.csv导入表.
ED1 ED2 ED3 ED4 ED5
1 NA NA NA NA
NA NA 1 NA NA
NA 1 NA NA NA
NA NA NA NA 1
Run Code Online (Sandbox Code Playgroud)
<-----等------>
因此每行只包含一个值"1",一行中的其他列包含NA.我需要将这五列合并为一个因子列.
喜欢:
EDU
2
3
3
1
2
1
或者这可能是因子列"ED1","ED2","ED3"等因素(作为源列的名称).
r ×8
r-markdown ×7
pandoc ×5
latex ×3
beamer ×2
ggplot2 ×2
knitr ×2
rstudio ×2
axis-labels ×1
bibliography ×1
charts ×1
csv ×1
markdown ×1
pdflatex ×1