gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 02:13:08 26 4
gpt4 key购买 nike

在这个例子中,我想在“第四集”和“新希望”之间换行,但是 \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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com