Questions tagged [officer]

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

413 questions
2
votes
1 answer

Change margins with officer

I am trying change the properties of a word document with the officer library and I am having problems to succeed. I need to change the margins of the entire document. Let's say I have this document: barometer <- read_docx %>% body_add_par("A…
Bruno Guarita
  • 767
  • 10
  • 21
2
votes
1 answer

In officer R, how to format text and bullet point levels for PowerPoint

So I am working on creating an automated powerpoint report in R using the officer package. I want to create a bulleted list with numerous levels but I need to be able to have specific text formatting for each line (i.e. I want the first two words to…
2
votes
2 answers

How to update PowerPoint slides from Shiny by using the package officer?

I would like to download PowerPoint slides from Shiny with the package officer. I made an PowerPoint example that contains a plot. How to update the slide if you change the inputs of the plot? Because when I changed the inputs, it didn't update the…
Quynh-Mai Chu
  • 165
  • 1
  • 9
2
votes
0 answers

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

I'm entering the task of creating automated reports using R. I have all the data that I need in a dataframe, and I have a template of the report in pptx format. The PPT has quite some design, so I'm preparing the slides instead of working with a…
2
votes
2 answers

Officer r package to create slides with side by side content -content only appearing in one section

Despite my best efforts, I cannot get any content loaded side by side in Powerpoint slides generated using the R package officer. What I would like is content (sourced images or plots, etc. on the right and text on the left). Here is my…
Cyrus Mohammadian
  • 4,982
  • 6
  • 33
  • 62
2
votes
1 answer

Keep aspect ration image with body_replace_img_at_bkm function officeR package

Is it possible to keep the original aspect ration while inserting an image in a .docx document with the function body_replace_img_at_bkm() from the package officer? my code looks like this: library(officer) library(magrittr) img.file <- file.path(…
2
votes
2 answers

Adding R officer ftext objects to an fpar object using a for loop

I am using the R package OfficeR to create a PowerPoint presentation of my calculation results. Would it be possible to add ftext objects to the same fpar under program control e.g. a for loop or an if statement? Something like: fp1 <- ftext("Line…
Gerben
  • 61
  • 3
2
votes
1 answer

Download existing docx object from R Shiny app

I am working on an R Shiny app where a user supplies information that modifies an existing Word document for the user to download. I've had trouble getting R Shiny to download the resulting new Word document. I've tried regular hyperlinks, and that…
petbadger
  • 51
  • 3
2
votes
1 answer

Officer: How to insert picture with it's original width and height

Just like in title: I'd like to add several external images to my .docx document. But when using body_add_img I need to specify width and height. Is there a way to set them to width and height of original image to be added? Why I need that? My…
Łukasz Deryło
  • 1,819
  • 1
  • 16
  • 32
2
votes
3 answers

Saving pptx as pdf in R

I have created powerpoint files using officer package and I would also like to save them as pdf from R (dont want to manualy open and save as pdf each file). Is this possible?
det
  • 5,013
  • 1
  • 8
  • 16
2
votes
0 answers

Why adding a flextable into Word from R using officer makes a Word document corrupted?

I'm creating a Word report using officer and flextable. Among others, I'm creating a flextable. The problem is that after printing it into Word, while trying to open, the document is showing error: "there is an error with its contents" ("the file…
Marta
  • 71
  • 8
2
votes
0 answers

Is there a function that will automatically center a flextable within a specific content placeholder?

I need to center a flextable based on the dimensions of the content placeholder. Is there a function or method that supports this? Passing coordinate arguments to ph_location_label() does not appear to work ph_with(ft, location =…
ma.miller
  • 21
  • 2
2
votes
1 answer

Formatting Text in Placeholders

I'm using officer to create many ppt files. I have a template that i have been using for over a year that's worked great. Since the latest update (6.23.2019) the formatting of the placeholders in the slide master of the template do not persist to…
2
votes
1 answer

What is the equivalent of officer::ph_location_fullsize( ) in the package rvg?

I would like to export multiple edible plots and tables from R to PowerPoint. Below is a snippet of the code that I have, and the packages I'm…
Wyn Z.
  • 35
  • 4
2
votes
1 answer

Adding image to flextable and generate my flextable in Word document using Rmarkdown

First, I'm using R 3.6.0 and Rstudio 1.2 with Windows 10. I am using flextable and Officer to create a Word document. Into this table I insert some images. To do this I am using flextable. When I use this code with a R script and officer that work.…
JRG
  • 21
  • 2