Questions tagged [officer]

officer is an R package for manipulating Word (.docx) and PowerPoint (*.pptx) documents.

413 questions
1
vote
0 answers

regex search expression to find chunked word text using officer in r

I would like to be able to add charts and tables at specific locations in a MS Word document based on a template, using Officer's body_add function. Since text in ms word can get chunked, is there a way to search for the expected text using regex,…
1
vote
1 answer

Align cells vertically to be at the bottom flextable

When I print a flextable to a word document the cell alignment vertically is defaulted to centered, but I'm wondering if there's a way to make the text sit at the bottom of the cell. I am aware of the flextable::align() function, but it only applies…
morgan121
  • 2,213
  • 1
  • 15
  • 33
1
vote
0 answers

Replace text and background color of a word document

I'd like to create a template with tags which are highlighted. The tags should be replaced with some data with R. I have highlighted text in the template file and want a blank background in the output file. I've tried officer because that seems to…
Birger
  • 1,111
  • 7
  • 17
1
vote
1 answer

When using officer and rvg, can you remove or prevent the background white square behind the image inserted into PowerPoint from the code?

When using officer and the rvg graphics I want my images to not have the background white square. The reason for this is that some functions leave a lot of empty space up at the top and often this will overlap with the header. I can go in and…
1
vote
1 answer

R officer package: Which layout property determines the proper index to uniquely identify placeholders?

According to the officer package documentation: index is to be used when a type is not unique in the slide layout I can't however find any information that identifies which property of a placeholder determines it's index. Below, I'm providing an…
Adam Birenbaum
  • 940
  • 9
  • 23
1
vote
0 answers

Keeping object placement consistent in officer package

I am having trouble with the officer package. Everytime I add a slide template to the template object, the indices seem to change. What is the logic on the indices? Is there one? In ReporteRs, the index was which order you added the placeholder…
Taylor
  • 76
  • 6
1
vote
1 answer

officer seems slow compared to ReporteRs

I have some scripts working well using ReporteRs and am trying to update them to use officer. My scripts are quite repetitive as I just need to output pretty much the same thing lots of times just changing font sometimes. After conversion I found…
Jim Smith
  • 11
  • 2
1
vote
1 answer

Can officer re-order slides?

Here's the situation: I have a (corporate) Powerpoint template which contains the Master, a Title slide, and a "Closing" last slide. I'd like to be able to use that as the basis for my work in R with officer , but don't see a way to reassign new…
Carl Witthoft
  • 20,573
  • 9
  • 43
  • 73
1
vote
1 answer

R ReporteRs: Adding a regulartable object to a pptx presentation

I'm having trouble adding a flextable to a PowerPoint presentation with the ReporteRs package, since the column names I want to display are not syntactically valid. So, apparently flextable only accepts data frames with syntactically valid column…
Tom Bombadil
  • 183
  • 4
1
vote
1 answer

How can i change in R the font family of a Title with officer?

How can I change the font family of a title in R with officer? I'm trying this with the function fp_text(font.family = "Arial"), but the problem is that the title which I define with fp_text does not end up in the table of contents.
Vitman
  • 11
  • 3
1
vote
1 answer

Address and manipulate text in a textfield and footer in Word documents with R officer package

I am working on a solution to change the text in several Word documents with similar structure. The text positions that I want to change are 1. in a textfield related to the header/footer and second in the first footer. I don't know how to address…
J Falke
  • 11
  • 3
1
vote
1 answer

R officer - Nest Dataframe Into Grouped List And Export Tables to Word With Group Headers

I read a similar question that helped me get to the point I'm at now, but am struggling with the next step. I have a dataframe similar to below - Product = c("Apple", "Apple", "Banana", "Banana", "Banana", "Carrot", "Carrot") Category…
Jamsandwich
  • 634
  • 1
  • 5
  • 25
1
vote
1 answer

R Create and execute an officer string

I want to create a powerpoint stack with pdfs I have created. I'm attempting to do this with officer. It works fine manually but I want to write the pdf out in code. Using a Two Content layout I want to write the name of the pdf into the title and…
JerryN
  • 2,356
  • 1
  • 15
  • 49
1
vote
2 answers

Add content to .docx via a loop?

My aim is to add repeated sections to a .docx file, changing values in successive sections by pulling them from a data frame. Using the example code at https://cran.r-project.org/web/packages/officer/vignettes/word.html, I have been able to add a…
Charles Knell
  • 117
  • 1
  • 9
1
vote
1 answer

Documentation of placeholder options

This is probably a very easy question to answer, but how can I find a list of options for placeholder arguments. In particular, ph_with_text(type = ...) For a Title and Content slide will accept type = 'title', while a Title Slide slide will not. It…
akorejwa
  • 137
  • 7