Questions tagged [officer]

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

413 questions
1
vote
1 answer

Can i change the formatting of specific words In my docx file with officer package in R?

I'm trying to change some specific words formatting to bold but can't find the the way to do it. For example: I would like to change the word "text" to bold in this code: doc <- read_docx() %>% body_add_par("This is a sample text", style =…
1
vote
1 answer

flextable Header Border with border.right argument

I am trying to put vertical borders on both sides of the header and am able to get a border for the left side but not the right side. library(officer) library(flextable) library(dplyr) bigborder <- fp_border(style = "solid",…
Ben
  • 77
  • 9
1
vote
0 answers

R officer: can I make a heading-4 paragraph with Arial font?

I create a Word document, I need Arial paragraphs with heading styles: doc2 = body_add_par(doc2, 'text', style = 'heading 4') Creates a Times New Roman font paragraph, but I need Arial, and this attempt gives me Warnings: doc2 = body_add_par(doc2,…
1
vote
0 answers

R: officer; Error in try to change body font size in pptx

Using R: officer package (R3.6.3), with this set of code lines...trying to change font size in body of pptx slide. Et seq... x = read_pptx() x = add_slide(x, layout = "Title and Content", master = "Office Theme") %>% ph_with(…
Benjamin Levy
  • 333
  • 6
  • 19
1
vote
1 answer

Changing the scale of a plot or table when generating a power point

I wish to be able to choose the dimensions of the plots I insert into my powerpoint when I generate them. I realise I could simply save them as a separate file and then insert them. But I would prefer to be able to manipulate them whilst I'm…
1
vote
1 answer

Regarding "officer" package and Table function in R

I have the following piece of code where I: 1) populate a data frame and its summary into PPT using officer package 2) Calculate summary from data frame using table function library(officer) df1 <- data.frame( Country = c("France", "England",…
ruser
  • 199
  • 12
1
vote
0 answers

read_pptx() throwing error when trying to read a pptx template file

I am trying to generate a report using a template .pptx file provided to me (originally within a zipped folder, which I extracted and saved locally). R is giving me the following error when I run this code: doc <-…
RPD
  • 11
  • 1
1
vote
1 answer

How to get formatting of styles in Word document in officer?

I want to write some documents with officer and I have some predefined styles in my word document that I load with read_docx(). Now I can look at the styles but I especially want to know which font type or which font size each style has and I cannot…
TobiSonne
  • 1,044
  • 7
  • 22
1
vote
1 answer

Splitting Rstudio's Viewer pane: possible?

I was wondering if there might be a way to split Rstudio's Viewer pane (like par(mfrow = 2:1) for the Plot pane) so that I could display 2 flextable objects? library('flextable') dat1 <- data.frame(Approaches = c("Y", "Y", "N"), Meets = c("N",…
rnorouzian
  • 7,397
  • 5
  • 27
  • 72
1
vote
1 answer

Displaying multiple tables using Package officer and flextable

I was wondering if it might be possible to display more than one flextable in the HTML format (on a single page) using flextable and officer? library('flextable') library('officer') dat1 <- data.frame(Approaches = c("Y", "Y", "N"), Meets = c("N",…
user8840683
1
vote
0 answers

Getting the font for a specified style

If I load up the default word document in officer and look at the styles that are available: library("officer") my_doc <- read_docx() styles_info(my_doc) I can see the following styles are available: style_type style_id …
1
vote
2 answers

Format multiple flextable columns by user defined function

Is there a way to display the numeric values inside a flextable in millions? I do not want to divide the numbers in the dataset to 1000000 before creating the flextable. For example, I want to display the number 1983445678 as 1,983 or 1,983.4 or…
1
vote
0 answers

Comparison between Officer and Reporters package for R

I have some questions regarding the Officer and Reporter packages for R. I am working to automate word document generation and have started using Officer. My searches indicate that there is more written about Reporter on the web and that the package…
I.Bow
  • 11
  • 2
1
vote
0 answers

officer: How to remove all the content from existing Word file

Just like in title: I have .docx document and I'd like to remove all the content from it. How to do it with officer? EDIT Why I need this? I write several tables, pieces of text and insert some pictures into .docx documnent and then copy them…
Łukasz Deryło
  • 1,819
  • 1
  • 16
  • 32
1
vote
0 answers

Is there a way to directly replace a table in a ppt slide with officer?

I've built out a shiny app to allow a few users within my organization to upload data, and print some tables to ppt. There is more information in the ppts than can be directly coded through shiny. At present, they download the ppt and then copy and…
jarichardson
  • 165
  • 8