officer is an R package for manipulating Word (.docx) and PowerPoint (*.pptx) documents.
Questions tagged [officer]
413 questions
2
votes
0 answers
How do I place a logo above the title using rmarkdown when using docx output
I'm trying to build a RMarkdown template to match a corporate template, which includes a large .png logo on the first page before the title, author and date.
With latex/pdf output we appear to be able to solve this with
--header-includes in the…

BetaScoo8
- 429
- 4
- 9
2
votes
1 answer
Missing outer border of a flextable in R
I have an issue I can't resolve. There may be something missing in the flextable package, but I may be wrong. Please, see the example.
This is my tabular data:
structure(list(groupName = c("Group A", "Group A", "Group A",
"Group A", "Group A",…

Jakub Małecki
- 483
- 4
- 14
2
votes
1 answer
Adding citations with R code in Rmarkdown document
To add a citation in Rmarkdown we can just type [@Author] in the document. I wonder if it's possible to do this with R code.
The pseudo code for my expected solution:
# just markdown
This is my markdown content and here is a great book about it: `r…

Jakub Małecki
- 483
- 4
- 14
2
votes
0 answers
In R's officer package, can you add a microsoft shape to a PowerPoint slide?
I'm using the officer package in R, and I have a lot of charts on a slide. To break up the slide, I want to add a shape in between them (think, a long narrow rectangle). I know I could save something as an image and put it in, but this code is meant…

J.Sabree
- 2,280
- 19
- 48
2
votes
0 answers
Is it possible to print an editable html table into officedown powerpoint?
I am trying to automate a PowerPoint presentation deck using officer in R. I am mostly working with the gt() package to make some tables (as I like the versatility of it) but the issue is that officedown requires me to save the gt() stuff as .png…

Gaetano Dona-Jehan
- 85
- 5
2
votes
0 answers
Change line spacing of multiline text added to powerpoint presentation in R
I am creating a slide using my powerpoint presentation template that has edited master slides.
The title and subtitle are following the formatting that I have defined in my slide master, but the body text is not.
my_pres <-…

Maral Dorri
- 468
- 5
- 17
2
votes
2 answers
insert space after each flextable in r (Rmd)
i have this problem:
Problem:
I have multiple flextable objects in a same r chunk:
mtcars %>%
select(1:3) %>%
head() %>%
flextable()
mtcars %>%
select(1:3) %>%
head() %>%
flextable()
But when i knit the Rmd in a…

Santiago Sotelo
- 180
- 12
2
votes
0 answers
Warning message in the officer package after adding exactly 100 slides
I get warning messages in the officer package after adding more than exactly 100 slides.
library(officer)
pres = read_pptx(path = NULL)
for (i in 1:100)
{
print(i)
pres <- add_slide( x = pres , layout = "Title Only", master = "Office Theme"…

Jan Bos
- 71
- 2
- 5
2
votes
0 answers
Insert Shape into MS Word with Officer
I'm using Officer to automate a report, but I would like for the header of the word document to have a colored shape behind it. Is there a way to do this in Officer?

John
- 21
- 1
2
votes
2 answers
How to extract images from word and powerpoint using media_extract in r?
I am working in rmarkdown to produce a report that extracts and displays images extracted from word and powerpoint.
To do this, I am using the officer package. It has a function called media_extract which can 'extract files from an rdocx or rpptx…

l.iles
- 31
- 5
2
votes
0 answers
Why isn't officedown for Rmarkdown outputting formatted text?
I am new to using Rmarkdown and officer/officedown, so maybe there is an easy fix for this, but I'm at a loss. I'm trying to create a Word document for reports using officedown/officer so that I can have greater control over the look of text and…

joerminer
- 153
- 8
2
votes
0 answers
Set Officer Powerpoint Layout to Widescreen
I'm making a powerpoint report in R using the officer package and can't figure out how to change the default layout to widescreen. The default aspect ratio is 4:3 but I'd like it widescreen (16:9). Any ideas on how to do this?

Logowilliams
- 98
- 8
2
votes
1 answer
Set width for flextable in a Word document with officer
I have a very simple task. Create a flextable (or qflextable) from a data frame. And then print it in Word. It is a 4 column table. The first column is a descriptive label and the other 3 are percentages or counts. In the first row below the…

Mark Danese
- 2,331
- 1
- 20
- 25
2
votes
1 answer
How to use `officer` to set the border color of an object in powerpoint?
I'd like to set the border color of a ggplot that I'm printing to a powerpoint using officer (not the plot.border element of the ggplot object, but the actual border line color of the object in Powerpoint).
I cannot figure out how to do it through…

redarah
- 152
- 7
2
votes
1 answer
R loop eating up memory
I am producing docx files using the officer library.
The database is not big (a few tens of lines and a few tens of columns).
After a certain number of iterations, the memory usage blows up and finally R crashes.
I cannot share the whole code and…

Alpi Murányi
- 1,117
- 10
- 17