officer

Adding bullet before statement in powerpoint via officer in R

家住魔仙堡 提交于 2021-01-29 09:17:51
问题 I am using the officer package in R to create reproducible slides. I can add bullets in front of sentences without problem when the sentences are places in the "body" object of the powerpoint template, but when I try to assign the exact location of the sentence, no bullets are included. Please see the script as below: library(officer) library(dplyr) pptx.output.st00 <- read_pptx() pptx.content1 <- c('sample sentence #1', 'sample sentence #2', 'sample sentence #3') pptx.content2 <- block_list

Adding bullet before statement in powerpoint via officer in R

我与影子孤独终老i 提交于 2021-01-29 09:07:33
问题 I am using the officer package in R to create reproducible slides. I can add bullets in front of sentences without problem when the sentences are places in the "body" object of the powerpoint template, but when I try to assign the exact location of the sentence, no bullets are included. Please see the script as below: library(officer) library(dplyr) pptx.output.st00 <- read_pptx() pptx.content1 <- c('sample sentence #1', 'sample sentence #2', 'sample sentence #3') pptx.content2 <- block_list

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

白昼怎懂夜的黑 提交于 2021-01-28 22:12:34
问题 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 layout pattern to make it easier. Slides have some pre-written paragraphs, and I need to insert data into specific positions of those paragraphs: for example, in one text box it says "in this case, there is a "value1"% of ..." and I would need to

How can i change in R the font family of a Title with officer?

十年热恋 提交于 2021-01-28 09:08:52
问题 How can I change the font family of a title in R with officer? I'm trying this with the function fp_text(font.family = "Arial") , but the problem is that the title which I define with fp_text does not end up in the table of contents. 回答1: It's kind of a pain, but the way I do it is: Add an empty placeholder in the title slot with ph_empty() Add formatted text with ph_add_fpar() , using fpar() , ftext() , and fp_text() to create the formatted text object. Here is an example of how to change

officer: edit Word table

半城伤御伤魂 提交于 2021-01-27 17:00:46
问题 Using "officer" I'm trying to edit the values of a Word table. Pretty straight forward to find the "paragraph" containing it library(officer) doc = read_docx('template.docx') doc = cursor_begin(doc) doc = cursor_reach(doc,"Some text") print(doc) and I get a document that looks like: * Content at cursor location: row_id is_header cell_id text col_span row_span 1.1 1 FALSE 1 D 1 1 1.5 2 FALSE 1 1 1 1.9 3 FALSE 1 Some text 1 1 1.13 4 FALSE 1 1 1 2.2 1 FALSE 2 More text 1 1 But, then what? There

officer: edit Word table

不羁岁月 提交于 2021-01-27 16:51:14
问题 Using "officer" I'm trying to edit the values of a Word table. Pretty straight forward to find the "paragraph" containing it library(officer) doc = read_docx('template.docx') doc = cursor_begin(doc) doc = cursor_reach(doc,"Some text") print(doc) and I get a document that looks like: * Content at cursor location: row_id is_header cell_id text col_span row_span 1.1 1 FALSE 1 D 1 1 1.5 2 FALSE 1 1 1 1.9 3 FALSE 1 Some text 1 1 1.13 4 FALSE 1 1 1 2.2 1 FALSE 2 More text 1 1 But, then what? There

Writing word documents with the officer package: How to combine several rdocx objects?

落爺英雄遲暮 提交于 2020-07-10 03:25:12
问题 I have several rdocx data objects created with the officer package in R. I want to combine these rdocx objects into only one rdocx object. Consider the following example: library("officer") # Create two rdocx data objects doc1 <- read_docx() doc1 <- doc1 %>% body_add_par("doc1_aaa", style = "Normal") %>% body_add_par("doc1_bbb", style = "Normal") %>% body_add_par("doc1_ccc", style = "Normal") doc2 <- read_docx() doc2 <- doc2 %>% body_add_par("doc2_aaa", style = "Normal") %>% body_add_par(

Change font size and style in officeR's body_add_table() function

走远了吗. 提交于 2020-01-15 15:53:52
问题 I am trying to change the font size in a table within the officer's body_add_table() function, with no success. How can I do this? I am using the following code: body_add_table(my_doc, value = tab02, style = "table_template", font.size = 10) 来源: https://stackoverflow.com/questions/53212878/change-font-size-and-style-in-officer-body-add-table-function

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

大憨熊 提交于 2019-12-23 18:13:59
问题 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 name [68] This is my code: library(qicharts2) library(gridExtra) library(officer) library(rvg) #24 random numbers from a normal distribution for example. y1 <- rnorm(24) y2 <- rnorm(24) yC1 <- qic(y1) yC2 <- qic(y2) grid <- grid.arrange(yC1,yC2) filename