- Notifications
You must be signed in to change notification settings - Fork109
👮 officer: office documents from R
License
Unknown, MIT licenses found
Licenses found
davidgohel/officer
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Make corporate reporting with minimum hassle
The officer package lets R users manipulate Word (.docx
) andPowerPoint (*.pptx
) documents. In short, one can add images, tablesand text into documents from R. An initial document can be provided;contents, styles and properties of the original document will then beavailable. It also supports the writing of ‘RTF’ documents.
The help pages are in a bookdown located at:
https://ardata-fr.github.io/officeverse/
Manuals are available at:
https://davidgohel.github.io/officer/.
Theread_docx()
function will read an initial Word document (an emptyone by default) and lets you modify its content later.
The package provides functions to add R outputs into a Word document:
- images: produce your plot in png or emf files and add them into thedocument, as a whole paragraph or inside a paragraph.
- tables: add data.frames as tables, format is defined by the associatedWord table style.
- text: add text as paragraphs or inside an existing paragraph, formatis defined by the associated Word paragraph and text styles.
- field codes: add Word field codes inside paragraphs. Field codes is anold feature of MS Word to create calculated elements such as tables ofcontents, automatic numbering and hyperlinks.
File generation is performed with theprint
function.
The functiondocx_summary()
reads and imports content of a Worddocument into a data.frame. The function handles paragraphs, tables andsection breaks. The functiondocx_comments()
reads comments of a Worddocument and organise the results into a data.frame.
The functionread_pptx()
will read an initial PowerPoint document (anempty one by default) and let you modify its content later.
The package provides functions to add R outputs into existing or newPowerPoint slides:
- images: produce your plot in png or emf files and add them in a slide.
- tables: add data.frames as tables, format is defined by the associatedPowerPoint table style.
- text: add text as paragraphs or inside an existing paragraph, formatis defined in the corresponding layout of the slide.
In a PowerPoint document, one can set a slide as selected and reach aparticular shape (and remove it or add text).
File generation is performed with theprint()
function.
Thepptx_summary()
function reads and imports content of a PowerPointdocument into a data.frame. The function handles paragraphs, tables andimages.
The packageflextablebrings a full API to produce nice tables and use them with packagesofficer and rmarkdown.
The packagervg brings an API toproduce nice vector graphics that can be embedded in PowerPointdocuments or Excel workbooks withofficer
.
The packagemschart combinedwithofficer
can produce native office charts in PowerPoint and Worddocuments.
The packageofficedownfacilitates the formatting of Microsoft Word documents produced by RMarkdown documents.
You can get the development version from GitHub:
devtools::install_github("davidgohel/officer")
Or the latest version on CRAN:
install.packages("officer")
If you have questions about how to use the package,visit StackOverflow’sofficer
tag and post yourquestion there. I usually read them and answer when possible.
Anyone getting involved in this package agrees to ourCode ofConduct.
When you file abugreport,please spend some time making it easy for me to follow and reproduce.The more time you spend on making the bug report coherent, the more timeI can dedicate to investigate the bug as opposed to the bug report.
A great way to start is to contribute an example or improve thedocumentation.
If you want to submit a Pull Request to integrate functions of yours,please provide:
- the new function(s) with code and roxygen tags (with examples)
- a new section in the appropriate vignette that describes how to usethe new function
- add corresponding tests in directory
tests/testthat
.
By using rhub (runrhub::check_for_cran()
), you will see if everythingis ok. When submitted, the PR will be evaluated automatically on travisand appveyor and you will be able to see if something broke.
About
👮 officer: office documents from R