436 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
36
views
Use a recorded plot for officer
To export a base R plot with officer, you have to wrap its code into plt_instr:
doc <- read_docx()
p <- plot_instr(
code = {
barplot(1:5, col = 2:6)
}
)
doc <- body_add_plot(...
-4
votes
0
answers
64
views
Print plot wrapped into officer's plot_instr [closed]
Exporting a base R plot into a Word document using the officer package requires wrapping the plot code with the plot_instr function:
library(officer)
p <- plot_instr(
code = {
barplot(1:5, ...
1
vote
1
answer
85
views
How can I have a powerpoint document created using OfficeR be downloadable by users of my app?
This is my first question since I cannot find any resources on using these two libraries together.
I use this for a user to decide to download the slides:
downloadButton("download.slides", &...
0
votes
1
answer
70
views
How to further fine-tune the RTF output of gtsummary when pagination is needed?
Based on the previous solution,
Does the gtsummary package have a function that allows the exported table to include footnotes on every page?
I successfully implemented pagination for the RTF output, ...
2
votes
1
answer
112
views
How to make the title of a gtsummary object correctly paginated and left-aligned when exporting using officer/flextable?
I have two main questions here. The first is how to control the alignment of the title specified in modify_caption so that it is displayed left-aligned when exporting to RTF using flextable/officer. ...
1
vote
1
answer
60
views
Saving modelsummary resulting flextable as .docx lose horizontal line that separates estimates from goodness of fit measure
Consider the following example:
library(modelsummary)
library(flextable)
library(officer)
modlm <- lm(gear ~ mpg + wt, data = mtcars)
res <- modelsummary(
modlm,
stars = TRUE,
out = "...
0
votes
1
answer
140
views
Extract/ subset rows from df start based on partial match in one column and ends extraction based on second column value
I want to extract information from a large df of multiple .docx files. Using the officer package I have so far read all .docx from a folder into 1 df. However I need a way to extract specific sections ...
0
votes
0
answers
73
views
Turn "Large ggplot_built" into regular ggplot so I can insert it in a word document using the officer package
I created ggplots in a massive function but when I call the function they only display in my plots window and not my global environment. I need them in my global environment so I can add them to a ...
1
vote
1
answer
60
views
grouping a table and a ggplot object and export to pptx as a editable graphic (svg converted to a forms)
I want to produce a pptx slide like this:
library(ggplot2)
library(grid)
library(cowplot)
library(dplyr)
# remotes::install_github("davidgohel/flextable")
library(flextable)
gg1 <-...
0
votes
0
answers
66
views
Customize flextable XML in Word documents using officer and flextable with new versions
I've extensively worked with older versions of the officer and flextable packages in R to create Word documents with tables. To achieve custom table formatting beyond the packages' default ...
2
votes
1
answer
178
views
Using officer in R to hyperlink to a heading within Word documents
I would like to generate Word documents with officer that contain links to other locations in the same document, e.g. if there is a figure that gets referred to in text elsewhere. Here's a simple ...
3
votes
1
answer
107
views
Save heatmap output/object
I have a code that makes a bunch of ggplot object, saves them as variables, then adds them to a list. I then loop through the list of plots adding them to slides in a powerpoint file using officeR. ...
1
vote
0
answers
22
views
How do I keep dml objects from moving when I convert from PowerPoint to Google Slides?
I'm automating powerpoint slides, and I want users to be able to edit the ggplots I have. As a result, I'm saving them as dml objects using the rvg package.
When I export it as a PowerPoint, all looks ...
2
votes
1
answer
94
views
How to increase resolution of ggplots without using ggsave in officer?
I'm using officer to automate powerpoint slides that contain ggplots. Unfortunately, the default resolution is poor. I saw a previous question from 6 years ago suggest using ph_with_vg(), but that ...
0
votes
1
answer
115
views
Is it possible to extract text from page headers and footers in DOCX
Is it possible to read the text of the headers and footers from a DOCX file with R?
I tried using the officer package for R. By using read_docx() and docx_summary() functions I was able to get the ...
Tom's user avatar
- 52.3k