Questions tagged [officer]

officer is an R package for manipulating Word (.docx) and PowerPoint (*.pptx) documents.

413 questions
0
votes
0 answers

How to expand flextable to take entire width of page?

Currently trying to generate tables in a Word document that take the entire width of the page (see current output below). I've gone between ending each table's statement with functions like flextable::autofit() or flextable::fit_to_width() but I…
big_cactus
  • 69
  • 1
  • 6
0
votes
0 answers

R: Automate inserting tables from list of data frames into multiple word documents

Is there a way to insert tables from a list of data frames into seperate word documents? I am building off of the previous help I received in a previous post: R: Automate generating word documents based on dataframe Here is an example data frame: DF…
0
votes
0 answers

Officedown Word footers not appearing as expected with landscape page

I have a template document (doc_temp6_git.docx) where the first|title page has a special footer, the option inside of the .docx does have the "different first page" option selected for footer 1 and is in portrait. The second page is the TOC which is…
0
votes
0 answers

Update an existing table in Word using officer/officedown

Is there a way using officer or officedown to update an existing table in Word? I tried to add a bookmark to an entire table in Word (say "tb1_bk"), but then I don't know how I could modify it. As I found no way to directly load it in shiny app as a…
Trichophyton
  • 625
  • 5
  • 21
0
votes
0 answers

How can I add indentation to a Word paragraph using the 'officer' package in R?

I am writing R code to automate several reports. The results have to be Word documents, so I am using the 'officer' package. Figure and table titles are added as seperate paragraphs using the ftext() function. This is done so that figure and table…
Hidl
  • 1
  • 2
0
votes
0 answers

Shiny- convert word document to html and allow users to preview

library(officer) library(flextable) library(ggplot2) I'm creating a shiny app that generates a word document, and I can do that but I also want the users to preview the results before they generate it. I am using pandoc_convert but the plot doesn't…
Mel
  • 157
  • 9
0
votes
0 answers

Avoid field updates when merging and printing word docx with {officer} package

I am stacking two docx, both of which have distinct dates in the title property, linked to a field in the respective document. I would like the date in docx1 to remain unchanged in the new combined docx ("current.docx") as it is when printed in…
David Lucey
  • 252
  • 3
  • 9
0
votes
0 answers

Why is the style = 'heading 1' and others not working in Officer?

This is the error that I get: Error: could not match any style named 'heading 1' in c('Normal', 'Body Text', 'First Paragraph', 'Compact', 'Title', 'Subtitle', 'Author', 'Date', 'Abstract', 'Bibliography', 'Heading 1', 'Heading 2', 'Heading 3',…
0
votes
0 answers

How to save officer-edited files as PDFs in R?

Recently I have been tasked with creating a program that will be able to auto-fill a form using data from an Excel spreadsheet. I have chosen to do this in R, since I know it the best, and used the package officer to do so. The program works, is…
Pawek-13
  • 3
  • 3
0
votes
1 answer

How to search and replace text in PowerPoint, using OfficeR

I am using officer to manipulate a PowerPoint template in order to fill placeholders with values calculated in r. Is there a way to do a search-and-replace to the texts in a slide?
BurninLeo
  • 4,240
  • 4
  • 39
  • 56
0
votes
0 answers

How can you change the alignment of the text in powerpoint text box using officer package. (top/middle/bottom)?

I am using the officer package to write text and tables to a powerpoint. I was wondering if anyone knows how to change the description variable below so that the text is aligned top (vs middle/bottom) in the textbox when it gets written to the…
megmac
  • 547
  • 2
  • 11
0
votes
0 answers

Adjust section identifier of cross reference according to loop iteration

I have to make a report which consists of parts that are always the same just with different filters. So I made one Rmd-file and loop over them. Now I have the problem that I want to cross reference a section. In the report it references to the…
0
votes
0 answers

How to add text in PowerPoint using 'officer' package in R when 'ph_with_text' is not available?

I am trying to add text in powerpoint using r by the officer package but the ph_with_text isn't available? library(officer) packageVersion("officer") officer::ph_with_text ph_with_text() Output: > library(officer) > packageVersion("officer") [1]…
JLit98
  • 13
  • 5
0
votes
0 answers

Is there a way to set `margin` values for ph_location object in officeR package?

I need to adjust the textbox margin values for items created using code like the following: label_par <- fpar( ftext("test", fp_text(bold = FALSE, font.size = 5, font.family = 'Arial')), fp_p = fp_par(text.align = "center") ) label_location…
0
votes
0 answers

display 3 images side by side in a word document using officeR

This R script loads three version of the same image and uses officer functions to create a word document that has them. The pos option after puts one image after the other, but does so with a return after each so they appear stacked. How do I make…
JerryN
  • 2,356
  • 1
  • 15
  • 49