Manipulation of Microsoft Word and PowerPoint Documents
Overview
Access and manipulate 'Microsoft Word', 'RTF' and 'Microsoft PowerPoint' documents from R. The package focuses on tabular and graphical reporting from R; it also provides two functions that let users get document content into data objects. A set of functions lets add and remove images, tables and paragraphs of text in new or existing documents. The package does not require any installation of Microsoft products to be able to write Microsoft files.
Features
body_add_gg()gains analt_textargument (asph_with()for ggplot
objects); if empty, the alt text defined with ggplot2::labs(alt = ...) is
used. body_add_img() gains an alt argument, passed to external_img()
(discussion #733).
docx_summary()gains apara_idcolumn containing the unique paragraph
id, allowing to join its results with those of docx_comments()
(discussion #732).
Issues
- headers and footers no longer disappear from even pages when a document is
opened with read_docx() and saved again. The "different odd and even pages"
option of the document was always switched on, even when it was off.
Show all changes in 0.7.7Hide the rest of the changes in 0.7.7
- a Word document created with officer and containing headers or footers can
now be opened again with read_docx() and saved without error.
- with
print(copy_header_refs = TRUE, copy_footer_refs = TRUE), headers and
footers of the default section are now added to the other sections without
replacing the ones a section already defines, and Word opens the result
without complaint.
- adding a list with
block_list_items()no longer removes the numbering of
the numbered headings of a template.
- lists added with
block_list_items()in a footnote, a comment, a header or
a footer are now displayed correctly by Word.
- images such as previews of embedded objects (e.g. EMF) are no longer lost
when saving a document (#730).
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-07-22
- NOTE11 OK, 2 NOTE2026-07-16
- OK13 OK2026-06-09
Show 2 earlier changesHide 2 earlier changes
- ERROR12 OK, 1 ERROR2026-06-07
- OK14 OK2026-03-10
Documentation
- Help pages
- 177 (33 internal)includes a package overview page
- Examples that run
- 100%152 run in a plain check (1 of them under a condition)
- Exported functions with examples
- 87%
- Documented parameters
- 91%
- Return-value docs
- 19%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- not measured
- Median days to close, 50 most recently updated closed issues
- 18
- Median days to close, 50 most recently updated closed PRs
- not measured
Stars over time
Forks over time
Releases over time
Issues over time
Commits over time
11 development-tooling and community-health practices detected across 6 families in the upstream repository
Checks run against github.com/davidgohel/officer on 2026-10-22.
The R CMD check workflow runs on Linux, macOS and Windows
GitHub Pages site last deployed 2026-10-14 · The repository has a site deploy workflow
pkgdown site last built 2026-10-14
Show all practicesHide 2 practices
Dependencies
Installing officer adds 31 packages (23 with compiled code, 22 MB of source tarballs). Heaviest: stringi 11 MB, openssl 1.1 MB, jsonlite 1.0 MB.
Show the 48 most downloaded dependentsHide the 48 most downloaded dependents
and 35 more dependents and 49 packages that suggest it on CRAN ↗
Code & Tests
People & History
Show 5 more contributorsHide 5 contributors
Pick two releases to compare their code metrics.
- 0.7.7Latest2026-10-14 · current release · diff ↗ ·
listed once in CRAN's queue
Seen in one reading of CRAN's incoming queue, at 2026-10-14 19:53 UTC, so it stayed less than the time between readings. - 0.7.62026-07-16 · diff ↗
- 0.7.52026-05-15 · diff ↗ ·
removed 1 export
run_seqfieldadded 4 exports
ooxml_chart_uris, rtf_set_paragraph_style, rtf_styles_info, solid_fill - 0.7.42026-04-24 · diff ↗ ·
added 11 exports
block_list_items, body_add_list, docx_embed_font, list_item, ph_with.block_list_items, sheet_add_drawing, sheet_names, sheet_remove, sheet_write_data, xlsx_drawing, xlsx_styles - RR 4.6.0 released · 2026-04-24
- 0.7.3
- 0.7.2
- 0.7.12025-11-14 · diff ↗ ·
removed 5 exports
slip_in_column_break, slip_in_footnote, slip_in_seqfield, slip_in_text, slip_in_xmladded 1 export
floating_external_img - 0.7.0
- 0.6.102025-05-30 · diff ↗
- 0.6.92025-05-21 · diff ↗ ·
added 6 exports
block_gg, body_append_start_context, body_append_stop_context, fp_par_lite, layout_default, write_elements_to_context - RR 4.5.0 released · 2025-04-11
- 0.6.82025-03-23 · diff ↗ ·
added 17 exports
slide_visible<-, ph_with.block_list, ph_with.character, ph_with.data.frame, ph_with.empty_content, ph_with.external_img, ph_with.factor, ph_with.fpar, ph_with.gg, ph_with.logical, ph_with.numeric, ph_with.plot_instr, ph_with.unordered_list, ph_with.xml_document, phs_with, resolve_location, slide_visible - 0.6.72024-10-09 · diff ↗ ·
added 6 exports
layout_rename_ph_labels<-, body_replace_gg_at_bkm, body_replace_plot_at_bkm, layout_dedupe_ph_labels, layout_rename_ph_labels, ph_location_id - 0.6.6
- RR 4.4.0 released · 2024-04-24
Show 54 earlier eventsHide 54 earlier events
- 0.6.5
- 0.6.42024-02-05 · diff ↗
- 0.6.3
- RR 4.3.0 released · 2023-04-21
- 0.6.22023-03-28 · diff ↗
- 0.6.12023-03-08 · diff ↗
- 0.6.02023-02-17 · diff ↗ ·
added 7 exports
image_to_base64, officer_url_encode, rtf_add, rtf_doc, str_encode_to_rtf, to_rtf, uuid_generate - 0.5.22023-01-27 · diff ↗
- 0.5.1
- 0.5.02022-12-21 · diff ↗ ·
added 5 exports
cursor_reach_test, docx_current_block_xml, docx_set_character_style, docx_set_paragraph_style, run_wordtext - 0.4.42022-09-10 · diff ↗
- 0.4.32022-06-13 · diff ↗ ·
removed 4 exports
ph_add_fpar, ph_add_par, ph_add_text, slip_in_imgadded 2 exports
sp_line, sp_lineend - RR 4.2.0 released · 2022-04-22
- 0.4.22022-03-23 · diff ↗ ·
removed 3 exports
ph_with_gg_at, ph_with_table_at, ph_with_textadded 3 exports
notes_location_label, notes_location_type, set_notes - 0.4.1
- 0.4.0
- 0.3.192021-07-21 · diff ↗
- RR 4.1.0 released · 2021-05-18
- 0.3.182021-04-02 · diff ↗
- 0.3.17
- 0.3.16
- 0.3.152020-11-01 · diff ↗ ·
added 5 exports
body_add_caption, body_add_plot, body_set_default_section, run_bookmark, run_word_field - 0.3.142020-09-07 · diff ↗ ·
removed 9 exports
body_default_section, body_end_section, break_column_before, ph_from_xml, ph_from_xml_at, ph_with_fpars_at, ph_with_gg, ph_with_table, ph_with_ul - 0.3.13
- 0.3.12
- 0.3.112020-05-18 · diff ↗
- 0.3.10
- 0.3.92020-05-04 · diff ↗ ·
added 8 exports
block_pour_docx, plot_layout_properties, prop_table, section_columns, table_colwidths, table_conditional_formatting, table_layout, table_width - RR 4.0.0 released · 2020-04-24
- 0.3.8
- 0.3.72020-03-02 · diff ↗ ·
removed 1 export
location_evaladded 20 exports
block_caption, block_section, block_table, block_toc, body_add, empty_content, get_reference_value, page_mar, page_size, plot_instr, prop_section, run_autonum, run_columnbreak, run_linebreak, run_pagebreak, run_reference, run_seqfield, to_html, to_pml, to_wml - 0.3.6
- 0.3.5
- 0.3.4
- RR 3.6.0 released · 2019-04-26
- 0.3.32019-03-01 · diff ↗ ·
removed 1 export
body_replace_atadded 9 exports
ph_location, ph_location_fullsize, ph_location_label, ph_location_left, ph_location_right, ph_location_type, ph_with, slide_size, unordered_list - 0.3.22018-07-23 · diff ↗ ·
added 4 exports
change_styles, docx_body_relationship, docx_body_xml, move_slide - 0.3.12018-06-12 · diff ↗
- 0.3.02018-05-03 · diff ↗ ·
removed 1 export
fortify_fparadded 18 exports
block_list, body_add_blocks, body_end_section_columns, body_end_section_columns_landscape, body_end_section_continuous, body_end_section_landscape, body_end_section_portrait, body_replace_img_at_bkm, body_replace_text_at_bkm, footers_replace_all_text, footers_replace_img_at_bkm, footers_replace_text_at_bkm, headers_replace_all_text, headers_replace_img_at_bkm, headers_replace_text_at_bkm, slip_in_column_break, slip_in_footnote, stext - RR 3.5.0 released · 2018-04-23
- 0.2.2
- 0.2.12018-01-08 · diff ↗
- 0.2.02017-12-03 · diff ↗ ·
added 8 exports
add_sheet, body_replace_all_text, docx_show_chunk, ph_with_gg, ph_with_gg_at, ph_with_ul, read_xlsx, sheet_select - 0.1.82017-10-06 · diff ↗
- 0.1.7
- 0.1.62017-08-30 · diff ↗
- 0.1.5
- 0.1.42017-06-07 · diff ↗
- 0.1.3
- 0.1.22017-04-29 · diff ↗ ·
removed 1 export
has_zipadded 11 exports
body_bookmark, cursor_bookmark, doc_properties, docx_dim, docx_summary, ph_empty_at, ph_from_xml_at, ph_with_img_at, ph_with_table_at, pptx_summary, set_doc_properties - RR 3.4.0 released · 2017-04-21
- 0.1.1
- 0.1.02017-03-01
- RR 3.3.0 released · 2016-05-03
Package metadata
- First published
- 2017-03-01
- Total releases
- 59 / 9 yrs
- License
- MIT + file LICENSE OSI · relicensed from GPL-3 in 0.5.1
- Download size
- 1.2 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("officer")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.