Questions tagged [officer]

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

413 questions
1
vote
1 answer

How to iterate in R to save multiple files simultaneously and avoid "Error in absolute_path(target) : 'x' must be a single character string"?

I'm using the officer package, and I want to make a one-slide PowerPoint document for each row in my data. My for loop works except for the file name. Whenever I try to give multiple file names, I get this error: Error in absolute_path(target) : 'x'…
J.Sabree
  • 2,280
  • 19
  • 48
1
vote
0 answers

Officer package in R : hyperlinks to Word documents

I would like to add hyperlinks to existing text in a Word document using the officer package (see cran) in R. Is there a simple way to do this? I do not seem to be able to do it using the function hyperlink_ftext().
1
vote
0 answers

officer seems to have a first slide by default

When I build a pptx deck in officer, I notice that the Title slide seems added by default. I can assume the structure of the Title Slide is present and begin adding content. However, only for this slide I see a mishmash of placeholder text and…
Joe
  • 3,217
  • 3
  • 21
  • 37
1
vote
2 answers

Cross-referencing tables {SEQ Table \\* arabic} and figures {SEQ Figure \\* arabic} with officedown [i.e. block_caption() and run_autonum()]

I want to create a .docx report with {officedown}, but instead of using "bookmark" reference types for cross-referencing my tables and figures as suggested in ch.4.6 and ch.4.7 of the User Documentation, I would like my references to be actual…
Paul Schmidt
  • 1,072
  • 10
  • 23
1
vote
1 answer

Inserting external image into PowerPoint with officer without changing image dimensions

Is it possible to insert external images into a Powerpoint with officer without changing the image dimensions? This is the code I have now where x is an rpptx object: library(officer) image_url <-…
Giovanni Colitti
  • 1,982
  • 11
  • 24
1
vote
1 answer

Blank lines formatting officer package R

I am currently using the Officer package to produce a Word document. I have been using body_add_par to add multiple chucks of blank lines throughout the document, but this method is already becoming tedious. Is there a way to create a function, or…
Hallie
  • 13
  • 3
1
vote
0 answers

ggsave: set width and height for powerpoint image

I am trying to change the height and width of an image with no success. The image needs to be put in an powerpoint presentation which works just fine. But for some reason it keeps stretching the image across the slide. After creating the image and…
Robbie Voort
  • 121
  • 6
1
vote
0 answers

Using officer in R to hyperlink to another slide within a flextable cell

Using officer in R, I've used ph_slidelink() to hyperlink a text box to another slide in the presentation, and I've used compose() and hyperlink_text() to hyperlink a cell within a flextable. My question is: is there a way to combine these, and to…
redarah
  • 152
  • 7
1
vote
1 answer

Making word documents A3 and Landscape orientation with Officer R package

Is it possible to make the documents by Officer R package both A3 and Landscape? I can make the document and pass in objects without problem for portrait and A4 but I can not find any documentation on how to make A3 or change orientation. mydoc <-…
Spooked
  • 586
  • 1
  • 4
  • 16
1
vote
0 answers

Add plot to document doesn't work inside function

not sure what the cause of the problem is here... Code works when I inline the function, but not when I call the function... Works: library(officer) data <- data.frame(test=c(1:10),test2=rep(c("a","b"),5)) doc <- read_docx() # Inlined…
Tschösi
  • 491
  • 3
  • 13
1
vote
1 answer

Extract bullets from Word Document in R

I have a Microsoft Word document that contains several bullets and nested bullets (sub-bullets), with up to three levels of nesting. I have been exploring the use of the officer package in R to read the text from the Word document, which I plan to…
StatsStudent
  • 1,384
  • 2
  • 10
  • 28
1
vote
1 answer

Using R to Automate Filename Retrieval in a Microsoft Word Table

I have a large table within a Microsoft Word document. The majority of rows, but not all, have a single Microsoft Word file attached. My job is to go into each row and manually type in the file name where an attachment is provided. Is there any way…
Eric
  • 2,699
  • 5
  • 17
1
vote
0 answers

Insert cover page into rmarkdown word document

I would like to insert a cover page for an Rmarkdown report. This would effectively be a background image and then the title sitting over the top. I am currently using a word template to provide other themes and settings as laid out in…
JFG123
  • 577
  • 5
  • 13
1
vote
0 answers

Rmarkdown officer / officedown / flextables problem

I have the following rmd script. I've spent a few days trying to get this to work but I am failing miserably. Basically I need help with three things. I am happy to post three separate questions if needed. The multicolumn options/code are…
J. Doe.
  • 1,255
  • 1
  • 12
  • 25
1
vote
0 answers

How to remove the automatically added blanc page in officer doc?

Using R 4.0.2, Officer 0.3.14 I produce docx files with landscape orientation using the code below library(officer) library(magrittr) landscape_one_column <- block_section( prop_section( page_size = page_size(orient = "landscape"), type =…
Arkadi w
  • 129
  • 22