Questions tagged [officer]

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

413 questions
3
votes
1 answer

How to print a list as bullet items in Word using Rmarkdown

I have a list that looks like [1] "SR7" "SW 38" "NW 35" "NW 34" [5] "NW 31" "NW 27 " "SW 24 " "SW 22" [9] "I-95 SB" "I-95 NB" I want to print them as bulleted items in word, using R-markdown. It looks like below SR7 SW 38 NW 35 NW 34 NW 31 NW…
naveen chandra
  • 149
  • 1
  • 7
3
votes
0 answers

Is there a way to edit existing slides using officer (or any other alternative) in R?

I have been trying to modify text elements in some particular slides of my PowerPoint using officeR package. However, I can only add a new slide and add text boxes etc. to it. Is it possible to edit an existing slide with all the formatting, text…
3
votes
1 answer

Unable to specify slide size when exporting a plot from R to a pptx file using R packages OFFICER and RVG

I have created a plot in R, and exported it as a vector object in a powerpoint slide (pptx file), using the "rvg" and "officer" packages (see code below). I would like to define the dimensions (height and width) of the slides in the pptx create by…
Aquilar C
  • 31
  • 2
3
votes
1 answer

Editing text of an existing pptx in officer R package

I just want to know if there is a way to EDIT TEXT of an existing powerpoint presentation with officer package in R. The base presentation must be edited with updated values monthly, while the images inside remains the same. I know I can locate the…
3
votes
0 answers

Retaining paragraph numbering in docx using the R officer package

How can I retain the numbering of paragraphs when extracting text from a docx file? I'm doing some NLP-ML work on a bunch of docx files, and to begin with I need to break up each doc into a dataframe. I'm working with contracts, such that almost…
mendy
  • 329
  • 1
  • 9
3
votes
2 answers

R and Microsoft Word: Updating text in one Word document based on text in another Word document

An updated version of my question. Below is code to produce two Word documents. The first document contains a series of table titles, each with an accompanying bookmark. The second document contains an actual table. What I'd like to be able to do…
Paul
  • 383
  • 4
  • 14
3
votes
0 answers

Change font color in flextable in R

Ciao, I have some trouble in changing font color in my flextable. The R version is 3.5.2 I am working on this object since I have to add the table on a pptx presentation and to do this I will of course use officer package. Let me show you a dummy…
clarkmaio
  • 359
  • 2
  • 12
3
votes
1 answer

Removing all line spacing from a flextable using flextable and officer packages in R

How do you remove all line spacing in a flextable when creating a flextable using the flextable package and printing it into a powerpoint document using the officer package in R? By default it appears to have line spacing 1.0 with spacing 2 pt…
Jordan Hackett
  • 689
  • 3
  • 11
3
votes
3 answers

Plotting a ggplot2 graph in a power point slide with a given size - R

I'm trying to plot a ggplot2 graph in a power point slide with the officer package. I can do it actually (printing the ggplot2 directly in the ppt), but as I need to increase the size of the ggplot2 graph (for the ppt slide), and I have understood…
Chris
  • 2,019
  • 5
  • 22
  • 67
3
votes
1 answer

Doesn't work body_replace_all_text() method in package "officer"

The code below doesn't work library(officer) library(magrittr) read_docx("/home/user/document.docx") %>% body_replace_all_text("placeholder1", "text1") %>% print(target = "/home/user/out.docx") output: Found 0 instances of 'placeholder1' in…
Sergey Nosov
  • 350
  • 3
  • 10
3
votes
1 answer

Add multiple bullets of text to PowerPoint slide via officer

Using the officer package in R, when working with a PowerPoint you can add text with the function ph_with_text. However, it's not clear how to add multiple bullets of text or how to set the level of indentation. I would like to achieve the…
Mark
  • 4,387
  • 2
  • 28
  • 48
3
votes
2 answers

How to increase resolution of ggplots when exporting using officer R

I want to export charts to a PPT and am using the officer package to achieve the same. However, the default resolution of the charts is low and I would like to change that. I am currently using the following call ph_with_gg(p1,type = "chart",res…
3
votes
2 answers

r - Why can't I send a group of plots in a grid to PowerPoint with officer?

I've created a grid of qicharts2 plots using gridextra but when I try to send it to PowerPoint using officer I get this error.. Error in doc_parse_raw(x, encoding = encoding, base_url = base_url, as_html = as_html, : StartTag: invalid element…
Gregx
  • 45
  • 4
2
votes
0 answers

Replace an entire table in an existing Word document

I have a need to replace nearly a hundred tables in a word document with updated data (not always the same number of rows and cols). Each table has a "Table heading" I can find in the docx_summary results... I have found this (not working) link in a…
Robbie
  • 61
  • 6
2
votes
1 answer

In R, why is my plot generated through nesting and mapping my data showing as a list instead of a ggplot object?

I'm making many plots by nesting my dataset and mapping over it. Ultimately, I want to put these plots into a PowerPoint deck using officer. I can make the plots, but for some reason, when I nest and map over it, R categorizes each plot as a list…
J.Sabree
  • 2,280
  • 19
  • 48