officer is an R package for manipulating Word (.docx) and PowerPoint (*.pptx) documents.
Questions tagged [officer]
413 questions
1
vote
0 answers
Displaying R code using officer package
I've just started learning how to make reproducible research documents using R. The officer package looks pretty amazing. I've managed to make a Word document, but feel like I'm struggling to understand exactly how to use the software. Currently,…

Paul
- 383
- 4
- 14
1
vote
2 answers
How to include hyperlinks in flextable?
I am trying to make a powerpoint file with officer that includes tables with hyperlinks in their cells, but I can't find a way how to do it.
E.g. a row in a 2 column table on a slide could include 'Ensembl' in the 1st column, the 2nd column would…

jd690764
- 21
- 1
1
vote
1 answer
How to add formatted paragraph (fpar) to Power Point presentation, right aligned, inside a place holder
I have the following code in R, using the library officeR, to create power point presentations.
No matter how I set the property "text.align" of the fp_par object (of fpar), the title remains centered.
Is there a way to add the new paragraph of…

Popescu Gabriel
- 137
- 6
1
vote
1 answer
Adding image to flextable using function
I am using Officer to create a Word document, which is a large table. Into this table I want to insert some images. To do this I am using flextable. The following code inserts an image into the flextable.
pupil.tbl <- tribble(
~col1, ~col2,
…

user2789093
- 371
- 3
- 12
1
vote
1 answer
Exporting all elements in column list using `officer`
I am working on a report for which I have to export a large number of similar data frames into nice looking tables in Word. I managed to the first bit by generating a column list of flextable objects using purrr (SO question for reference).
Now I…

tifu
- 1,352
- 6
- 17
1
vote
0 answers
Combining powerpoint officer objects
Using the code below, is there an easy way to combine presentations p1 and p2 together?
library(officer)
library(magrittr)
p1 = read_pptx() %>% add_slide(layout = "Two Content", master = "Office Theme") %>% ph_with_text(type = "body", str =…

John Harrold
- 33
- 5
1
vote
0 answers
Data label font family and size using mschart package
I've been using the officer package for a few months now, but just getting into the mscharts package. I can't seem to find a way to adjust the font size and family of my charts' data labels.
Is there some function I'm not seeing that allows options…

Brent
- 11
- 2
1
vote
1 answer
ph_with_vg and ggplot on R
I am able to create my desired chart using ggplot using the following code:
ggplot(data, aes(x=as.Date(data$Date, "%d/%m/%Y"), y=items)) + geom_col(fill="#00cccc")
However, when i use it with my full code, i get an error that reads…

nics
- 13
- 5
1
vote
3 answers
How to add hyperlinks to word docx using officeR?
How does one add a hyperlink using officeR? In the ReporteRs package there was a POT with a hyperlink parameter; but I dont see anything remotely close in the OfficeR package.

Mike Carmine
- 23
- 4
1
vote
1 answer
Best practice to add tables for model objects to officer/ReporteRs
flextable::body_add_flextable enables inserting flextable to Word document created by officer. The examples included in the packages are for creating tables from data frames. My question is, what the best practice of creating tables from model…

LmW.
- 1,364
- 9
- 16
1
vote
2 answers
ph_slidelink - not sure how to use it?
it is great that officer has a function to create links to slides internal to the presentation. However I don't know how to use it from the examples available. I never see an actual hyperlink to a page appearing in the example below e.g.:
fileout <-…

Daniel Sabanes Bove
- 125
- 7
1
vote
0 answers
Text alignment in power point with R / officer
I am experimenting with the automation of some reports and I would like to stick to the corporate power point style (at least as much as possible). Using directly the available template with
ppt <- read_pptx("myTemplate.pptx")
is quite complicated…

danilo mercurio
- 21
- 2
1
vote
1 answer
Adding Tables w/o Column Headers in Officer
Trying to add a table from a data frame in a .docx document using officer, but without including a row for the column header. I've tried removing the column names from the data frame before adding it to the document, but that has not worked and…

Jason Clark
- 78
- 6
1
vote
1 answer
Officer - Error when adding a level 1 paragraph onto existing slide
I'm trying to write a sequence of bullet points onto the same slide, with the following R-Code:
library(officer)
library(magrittr)
ppt <- read_pptx()
ppt <- ppt %>%
add_slide(layout = "Title and Content", master = "Office Theme") %>%
…

rcst
- 175
- 9
1
vote
1 answer
In R, how to add text to Powerpoint at arbitrary location so it inherits style?
The R officer package is very good at letting you insert text into existing placeholders in a powerpoint deck. For instance, this code:
library(tidyverse)
library(officer)
pres <- (read_pptx()
%>% add_slide(layout = "Title and Content", master =…

bescoto
- 11
- 2