r - 在 ReporteRs 中添加标题换行符

标签 r newline reporters

在这个例子中,我想在“第四集”和“新希望”之间换行,但是 \n 不起作用...我该怎么做?

library("ReporteRs")
deck <- pptx( title = "Star Wars Movies")  
deck <- addSlide( deck, slide.layout = "Title and Content" )
deck <- addTitle( deck, "Episode IV\nA New Hope")
# spoiler alert
deck <- addParagraph(deck, paste("This movie is about Luke Skywalker, Han Solo,",
                                 "Obi-Wan Kenobi, and some droids who rescue",
                                 "Princess Leia and blow up the Death Star.") )
writeDoc(deck, file = "temp.pptx" )

enter image description here

最佳答案

仅使用\r\n 而不是\n

library("ReporteRs")
deck <- pptx( title = "Star Wars Movies")  
deck <- addSlide( deck, slide.layout = "Title and Content" )
deck <- addTitle( deck, "Episode IV\r\nA New Hope")
# spoiler alert
deck <- addParagraph(deck, paste("This movie is about Luke Skywalker, Han Solo,",
                                 "Obi-Wan Kenobi, and some droids who rescue",
                                 "Princess Leia and blow up the Death Star.") )
writeDoc(deck, file = "temp.pptx" )

关于r - 在 ReporteRs 中添加标题换行符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36506787/

相关文章:

R 字符串只包含一种类型的字符

c++ - R 中的 LoadLibrary 失败 : %1 is not a valid Win32 application.

r - 线性混合建模可以处理响应变量和/或预测变量中的 NA(缺失数据)吗?

java - 安装 ReporteRsjars 时无法加载 rJava.dll - 不是有效的 Win32 应用程序

r - 在段落内插入情节

css - 将自定义 CSS 标签添加到 RMarkdown html 文档

Eclipse 和 Windows 换行符

python - 使用 Python 将列表写入文件,使用换行符

c++ - 移动到文件中的下一行 C++