GithubHelp home page GithubHelp logo

nfrechen / officer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from davidgohel/officer

0.0 1.0 0.0 3.87 MB

:cop: officer: office documents from R

Home Page: https://davidgohel.github.io/officer/

R 80.32% C++ 19.68%

officer's Introduction

officer R package

The officer package lets R users manipulate Word (.docx) and PowerPoint (*.pptx) documents. In short, one can add images, tables and text into documents from R. An initial document can be provided, contents, styles and properties of the original document will then be available.

This package is close to ReporteRs as it produces Word and PowerPoint files but it is faster, do not require rJava (but xml2) and has less functions that will make it easier to maintain.

Make corporate reporting with minimum hassle

Travis-CI Build Status Build status version cranlogs Active

Word documents

Function read_docx will read an initial Word document (an empty one by default) and let 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 the document; as a whole paragraph or inside a paragraph.
  • tables: add data.frames as tables, format is defined by the associated Word table style.
  • text: add text as paragraphs or inside an existing paragraph, format is defined by the associated Word paragraph and text styles.
  • field codes: add Word field codes inside paragraphs. Field codes is an old feature of MS Word to create calculated elements such as tables of content, automatic numbering and hyperlinks.

In a Word document, one can use cursor functions to reach the beginning of a document, its end or a particular paragraph containing a given text. This cursor concept has been implemented to make easier the post processing of files.

The file generation is performed with function print.

import Word document in a data.frame

Function docx_summary read and import content of a Word document into a tibble object. The function handles paragraphs, tables and section breaks.

PowerPoint documents

Function read_pptx will read an initial PowerPoint document (an empty one by default) and let you modify its content later.

The package provides functions to add R outputs into existing or new PowerPoint 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 associated PowerPoint table style.
  • text: add text as paragraphs or inside an existing paragraph, format is defined in the corresponding layout of the slide.

In a PowerPoint document, one can set a slide as selected and reach a particular shape (and remove it or add text).

The file generation is performed with function print.

import PowerPoint document in a data.frame

Function pptx_summary read and import content of a PowerPoint document into a tibble object. The function handles paragraphs, tables and images.

Tables and package flextable

The package flextable brings a full API to produce nice tables and use them with officer.

Installation

You can get the development version from GitHub:

devtools::install_github("davidgohel/officer")

Or the latest version on CRAN:

install.packages("officer")

Plan / to do list

  • enable access to headers and footers in Word documents
  • improve tests and documentation (help is more than welcome)

officer's People

Contributors

davidgohel avatar jonmcalder avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.