officer is an R package for manipulating Word (.docx) and PowerPoint (*.pptx) documents.
Questions tagged [officer]
413 questions
0
votes
0 answers
"attempt to apply a non function" error when attempting to remove slide in officeR
I am trying to remove a slide and consequently add a slide with content using the OfficeR package. The read_pptx() function read the layout of the template uploaded without error but am running into trouble when modifying the template.
my_report <-…

afc
- 1
0
votes
0 answers
"Error in xml_ns.xml_document(x) : external pointer is not valid"
I'm using the officer package to automate powerpoint reporting but I am encountering the below error:
"Error in xml_ns.xml_document(x) : external pointer is not valid"
when I try to run the code below. Essentially I am trying to bold the word…

terry
- 1
- 2
0
votes
1 answer
Placement of subtitle paragraph before table when exporting multiple tables to DOCX with officer
I want to export multiple tables with a multi row caption or header to the same document using the officer package.
Background: In my company docx template a table or plot has a caption which consists of a title and a subtitle, both with their own…

stefan
- 90,330
- 6
- 25
- 51
0
votes
0 answers
Cannot change font colour in Powerpoint template with Officer
I have a custom PPT template that I am using successfully to display all sort of information - I m now trying to format the color of some of the text based on specific rules.
I haven't included the rules here.
I have followed some examples…

Guillaume Lombard
- 104
- 8
0
votes
0 answers
Add many hyperlinks to word doc programmatically via R script
Suppose I have a very large word document with a TOC, sections, tables, and figures. I have a spreadsheet (lookup) with two fields: text of interest, and hyperlink location.
Can I leverage the officer package to scan through the document's content,…

Vinh Nguyen
- 1,014
- 1
- 9
- 19
0
votes
0 answers
How to set table text wrapping to "around" in a Word document using flextable in R?
Is there a way to set table text wrapping to "around" for a flextable being printed into a Word document using the flextable and/or officer packages in R?
I want to accomplish the equivalent of right clicking on a table in Word and choosing "Table…

Jordan Hackett
- 689
- 3
- 11
0
votes
1 answer
Is it possible to put dplyr pipes into a function to consolidate repetitive code in R?
I am making a powerpoint in R using officer. All my slides have the same layout so I am trying to write a function to consolidate the code.
suppressPackageStartupMessages({
library(officer)
library(tidyverse)
})
This is an example of what I…

Noah_Seagull
- 337
- 5
- 18
0
votes
1 answer
Replacement for slip_in_text() in officer
I am creating a Word file from R using the officer package version 0.4.4.
In the past I used the slip_in_text() function often but that function is removed:
Error: 'slip_in_text' is defunct.
Use 'fpar()' instead.
My problem with fpar() is that it…

Gerben
- 61
- 3
0
votes
1 answer
Error message: "is_scalar_character(new_value) is not TRUE" in officer-package R
I wanna replace text by keywords via officer
Until now I had good experiences with that package. And I could work easily in it.
Today I encountered a problem, an error message a never had before and cannot solve on my own:
Error in…

Nadiine El Nino
- 339
- 1
- 6
0
votes
0 answers
Hard return instead of soft return in flextable cell
If I use a linebreak "\n" in flextable I get a soft return in word. This is intended and also stated in the documentation. But what if I really want a hard return? It would be no problem for me if the code for that was hacky. Couldn't find anything…

TobiSonne
- 1,044
- 7
- 22
0
votes
0 answers
Not able to pull images from server into word doc created using office package in R
docx<- read_docx()
officer::body_add_img(docx,src = Screenshot(2).png,
height = 4,
width = 6.25)
print(docx,target="testing1.docx)
src parameter reads in the image from the server. The…

Narayan Shubha
- 45
- 1
- 6
0
votes
0 answers
Flextable and Officer - Prevent table headers from being on a separate page from the table when exporting to Word
When I print large flextable to Word using Officer, the header will appear on a separate page than the table itself. For example
test = read.table(text = 'columnA columnB
TextA TextB
TextA TextB
TextA TextB
TextA TextB
TextA TextB
TextA TextB
TextA…

Parseltongue
- 11,157
- 30
- 95
- 160
0
votes
1 answer
Dynamically generating figures with captions in Word output from Rmarkdown document
I'm trying to generate a Word document with figures. I use {officedown} and {officer} packages. I need to do it dynamically, in a loop since I don't know how many figures there will be. This is my Rmarkdown code:
---
output:
…

Jakub Małecki
- 483
- 4
- 14
0
votes
0 answers
What is the 'id' in officers layout_properties refrencing?
What is the id in layout_properties? I'm not sure if the id is referring to the placeholder or something else. Here's an example:
master_name name type id ph_label …

wigglesthe3rd
- 81
- 6
0
votes
0 answers
How can I replace a part of pre-written text via officer/r in Powerpoint
Is there a way to read the text of a slide from Powerpoint and then replace a part of the text with a value from R. See image 1, the black text is added by an user, and the red text is written by the R notebook.
I want to do the writing part in…

Robg
- 1
- 2