3

在这个例子中,我想在“Episode IV”和“A New Hope”之间添加一个换行符,但是\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" )

在此处输入图像描述

4

1 回答 1

4

使用\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" )
于 2016-04-08T18:35:39.430 回答