officer is an R package for manipulating Word (.docx) and PowerPoint (*.pptx) documents.
Questions tagged [officer]
413 questions
0
votes
1 answer
Make officer fpar recognize a string refer to multiple ftext objects
I have a string with the names of a bunch of different ftext objects.
library("officer")
library("stringr")
itanor <- fp_text(font.size = 10, italic = T, font.family = "Open Sans")
normal <- fp_text(font.size = 10, font.family = "Open Sans")
h <-…
0
votes
1 answer
Is there a way to change the device output of officedown::rdocx_document() from .jpg to .emf?
When using officedown::rdocx_document in R Mardown, the Office Word output will include the plots as a .jpg image although my desire is to automatically include the plots of my R markdown in format .emf (Enhanched Metafile).
I know that with the…

Santiago Sotelo
- 180
- 12
0
votes
0 answers
Piechart with mschart (r package)
With the package mschart, it is possible to create several kinds of charts, according to the official documentation
ms_areachart()
ms_barchart()
ms_linechart()
ms_scatterchart()
However, piechart is not one of them. Is it possible to modify of…

John Smith
- 1,604
- 4
- 18
- 45
0
votes
1 answer
Generate parameterized ppt reports using officer
Using code below, I'm able to generate a ppt report for subset of mtcars dataset:
library(ggplot2)
library(tidyverse)
library(patchwork)
library(officer)
library(officedown)
library(glue)
small <- mtcars %>%
filter(carb %in% c(1, 2))
p1 <-…

ah bon
- 9,293
- 12
- 65
- 148
0
votes
0 answers
Remove axis_text in mschart (r package)
With mschart, one create charts in R and export them in ppt.
There are different options in mschart_theme for styling.
For axis_text_x, we can use the function fp_text from the package officer.
Now my question is: is it possible to remove completely…

John Smith
- 1,604
- 4
- 18
- 45
0
votes
1 answer
create pdf from word WITHOUT libreoffice
I'm using officer to create a word document in an application deploy through shinyapps.
That discards the use of libreoffice, the "install and define the path" thing.
So, is there a way to create pdf from docx without the need of libreoffice?
Thanks

Mikael
- 113
- 1
- 8
0
votes
2 answers
Best way to insert a custom TOC in officer
I need to insert a custom TOC into an officer document. In this case I need to insert a list of tables that are created using the level 6 headers. The TOC field I need to insert is:
{TOC \o "6-6" \* MERGEFORMAT}
The block_toc function doesn't seem…

John Harrold
- 33
- 5
0
votes
0 answers
When partially bolding title in ggplot2 via element_markdown and pasting to powerpoint using officeR, words are not aligned
My goal is simple: I want to create a title in ggplot2 where some words are bolded and some are not, then use OfficeR to add it to a Powerpoint object and print said object.
Every time I try to do this however, each word in the PowerPoint title is…

waterboy
- 13
- 2
0
votes
1 answer
Officer for Rmarkdown: Cross-referencing block_captions not numbering correctly
I'm using run_autonum and block_caption from the officer package to create figure captions for my supplemental figures and then cross-reference them (want to be a separate series than the non-supplemental figures so the numbering restarts). The…

Alton
- 137
- 6
0
votes
0 answers
r Remove xlsx sheet using officer package
I am developing an R shiny app that will generate a sequence of editable charts in an Excel file using the officer package. However, when creating a new .xlsx file using the read_xlsx() function, the file contains a blank first sheet entitled…

lrclark
- 81
- 8
0
votes
0 answers
officer::body_replace_all_text not working in footnote
I am unable to replace text in a footnote (I can replace body text, and footer, but not in footnotes). Is the officer package unable to replace in footnotes? I am open to work-arounds, other packages, etc.
abc <- "this won't be found in…

JHawkins
- 243
- 1
- 2
- 10
0
votes
1 answer
Why won't R Shiny's document handler export my reactive flextable to PowerPoint?
I'm trying to export a flextable to PowerPoint and have users download the PowerPoint. The table involves merging two datasets together based on users inputs. However, when I try to export the document, clicking the document handler names the…

J.Sabree
- 2,280
- 19
- 48
0
votes
0 answers
How to find all options for individual arguments in R?
I'm trying to use the add_slide() function in the officer package, and one argument is layout. How do I see all the possible options for this argument or any other? I know how to see all arguments for a function, such as by using args(add_slide) or…

J.Sabree
- 2,280
- 19
- 48
0
votes
1 answer
How to put a subscript in a caption of a Word document using officer in R
I am trying to add a subscript to a caption generated in officer.
I am creating the caption like this:
library(officer)
doc <- read_docx('empty_file.docx')
autonum <- run_autonum(seq_id = 'fig', pre_label = 'Figure ')
caption <-…

Ruben
- 23
- 2
0
votes
1 answer
OfficeR: How to add text in word document template on a placeholder
I want to generate a word document from a pre saved word template, I have added placeholders on word template, but I'm not able to save the texts on placeholder location. I tried using ph_with function but it gives error as its for .pptx, please…

Surya
- 3
- 2