officer is an R package for manipulating Word (.docx) and PowerPoint (*.pptx) documents.
Questions tagged [officer]
413 questions
1
vote
1 answer
Background color in cells in a table
I am creating tables using flextable and officer. I would like to apply conditional formatting to cells, e.g., if a value is > 1.5, apply a colored background. I understand how to color entire rows or columns but not individual cells. Is this…

Dennis Fisher
- 31
- 2
1
vote
0 answers
Generating Multi level lists in Word with Bullets Using Officer in R
I am trying to generate a MS Word document in R using the officer package. I found functions like unordered_list with level_list as an argument to generate unordered list of text for Powerpoint but not for Word. Any idea how can I recreate the…

Dhiraj
- 1,650
- 1
- 18
- 44
1
vote
0 answers
Export GT table with Officer
I am trying to export a gt table using the package officer but I get this error message.
Error in UseMethod("ph_with", value) :
no applicable method for 'ph_with' applied to an object of class "c('gt_tbl', 'list')"
I already updated officer and…

GFHR
- 11
- 1
1
vote
1 answer
R flextable proc_freq remove label column
Is there a way to remove the label column from the proc_freq() flextable after it has been created?
When a flextable is created from scratch, i.e. from a dataframe, one can specify with col_keys the columns to display. However, proc_freq() generates…

user23413
- 308
- 2
- 7
1
vote
1 answer
Ensure S3 methods from dependent package are loaded when using double colon (::)
When using S3 methods from dependent packages, how do I ensure that a package loads (and attaches?) all dependent packages when called using the double colon (::) operator without a prior library() call?
I am developing a package package3 that uses…

Jonas
- 95
- 2
- 2
- 9
1
vote
1 answer
Using header after page 1 (frontpage) using OfficeR
I followed the steps in this answer to combine two documents
Writing word documents with the officer package: How to combine several rdocx objects?
But one document is a frontpage and the other document has headers. The problem is that when I join…

Mikael
- 113
- 1
- 8
1
vote
0 answers
Officer word breakline to replace multiple line text R
I am using officer R package to replace values in a Word document. How to replace existing placeholder (here place) by a multi line text of unknown length? I have tried \n and
for breakline without success. library(officer) my_doc <-…
for breakline without success. library(officer) my_doc <-…

Clemsang
- 5,053
- 3
- 23
- 41
1
vote
1 answer
How to add a flextable and text with multiple columns on same landscape page
I want to create on the same word landscape document both a table and text formatted in column.
The problem is that whenever I add body_end_section_columns_landscape() it creates a new page.
Example of working code in portrait…

Arkadi w
- 129
- 22
1
vote
1 answer
Officer: power point slides with ggplot(s) AS IMAGES
The code below creates a PowerPoint slide with a vector based ggplot-object, this works great.
Now I want the same slide, with graph as image (e.g. PNG, un-editable). I think this was possible using ph_with_gg(plot, resolution) etc., but that's now…

Christian
- 11
- 2
1
vote
0 answers
Update text in Word textbox using R (officer package)
I have a word document filled with text boxes that I would like to update. When I read the document in it appears black because of the text is in text boxes. Is there functionality within OfficeR that I'm missing that could update this text or is…

user9568744
- 91
- 8
1
vote
1 answer
Customize text in the ph_with function from the officer package in R
I am trying to automate my PowerPoint reports using the officer package; however, I cannot find out how to customize the text (font size, color, font).
To add in text, I'm using the ph_with() function. I tried to customize it using officer's ftext()…

J.Sabree
- 2,280
- 19
- 48
1
vote
1 answer
Row heigth with flextable and officer
I have a new computer (read: new versions of everything, including Office 2016)
I created the following code on my previous computer, and all worked fine:
...
control_table <- regulartable(data = data) %>%
theme_box() %>%
rotate(rotation =…

HannesP
- 13
- 2
1
vote
1 answer
officedown not producing output: Error: read_docx only support docx files
I'm new to officedown. I'm currently reviewing it to see if the company wants to use it in production.
I'm having problems producing output from one of their examples: minimal_word.Rmd.
Weirdly, I am able to run all their other examples (also in…

AMM
- 21
- 3
1
vote
2 answers
R Repeat function on object
I am trying to use officer to add images to a Word document. I have a whole directory's worth of images that I want to loop through. The problem I am having is that I need to add the image to the document, then add the next image to the newly…

hmhensen
- 2,974
- 3
- 22
- 43
1
vote
1 answer
Adding bullet before statement in powerpoint via officer in R
I am using the officer package in R to create reproducible slides. I can add bullets in front of sentences without problem when the sentences are places in the "body" object of the powerpoint template, but when I try to assign the exact location of…

lokheart
- 23,743
- 39
- 98
- 169