Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ardata-fr/mschart
:bar_chart: mschart: office charts from R
https://github.com/ardata-fr/mschart
cran ms-office-documents office powerpoint r word
Last synced: 20 days ago
JSON representation
:bar_chart: mschart: office charts from R
- Host: GitHub
- URL: https://github.com/ardata-fr/mschart
- Owner: ardata-fr
- License: other
- Created: 2017-07-17T20:51:34.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-04T09:30:30.000Z (7 months ago)
- Last Synced: 2024-10-22T07:45:09.684Z (about 2 months ago)
- Topics: cran, ms-office-documents, office, powerpoint, r, word
- Language: R
- Homepage: https://ardata-fr.github.io/mschart
- Size: 3.34 MB
- Stars: 131
- Watchers: 10
- Forks: 25
- Open Issues: 14
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - ardata-fr/mschart - :bar_chart: mschart: office charts from R (R)
README
---
title: "mschart R package"
output: github_document
---```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```[![R build status](https://github.com/ardata-fr/mschart/workflows/R-CMD-check/badge.svg)](https://github.com/ardata-fr/mschart/actions)
[![version](https://www.r-pkg.org/badges/version/mschart)](https://CRAN.R-project.org/package=mschart)
![cranlogs](https://cranlogs.r-pkg.org/badges/mschart)
![Active](http://www.repostatus.org/badges/latest/active.svg)
The `mschart` package provides a framework for easily create charts for
'Microsoft PowerPoint' presentations and 'Microsoft Word' documents. It has to
be used with package [`officer`](https://davidgohel.github.io/officer/) that
will produce the charts in new or existing PowerPoint or Word documents. With
'Microsoft Charts', the data is integrated into the document and linked to the
chart. The result can be edited, annotated and resized. If the data is updated
in the document, the chart is also updated.## Example
This is a basic example which shows you how to create a scatter plot.
```{r example}
library(mschart)
scatter <-
ms_scatterchart(
data = iris, x = "Sepal.Length",
y = "Sepal.Width", group = "Species"
)
scatter <- chart_settings(scatter, scatterstyle = "marker")
```Then use package `officer` to send the object as a chart.
```{r eval=FALSE}
library(officer)
doc <- read_pptx()
doc <- add_slide(doc, layout = "Title and Content", master = "Office Theme")
doc <- ph_with(doc, value = scatter, location = ph_location_fullsize())print(doc, target = "example.pptx")
```At any moment, you can type `print(your_chart, preview = TRUE)` to preview the
chart in a temporary PowerPoint file. This requires to have a PowerPoint Viewer
installed on the machine.## Installation
You can get the development version from GitHub:
```{r eval = FALSE}
devtools::install_github("ardata-fr/mschart")
```Or the latest version on CRAN:
```{r eval = FALSE}
install.packages("mschart")
```## Contributing to the package
### Bug reports
When you file a [bug report](https://github.com/ardata-fr/mschart/issues),
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 time I can dedicate
to investigate the bug as opposed to the bug report.