https://github.com/Ractuary/summaryrow
Flexible tool for adding summary rows to a data frame
https://github.com/Ractuary/summaryrow
Last synced: 4 months ago
JSON representation
Flexible tool for adding summary rows to a data frame
- Host: GitHub
- URL: https://github.com/Ractuary/summaryrow
- Owner: Ractuary
- License: gpl-3.0
- Created: 2016-03-17T21:12:18.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-10T19:40:58.000Z (almost 8 years ago)
- Last Synced: 2024-11-30T01:45:02.769Z (5 months ago)
- Language: R
- Size: 41 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - Ractuary/summaryrow - Flexible tool for adding summary rows to a data frame (R)
README
# summaryrow
[](https://travis-ci.org/merlinoa/summaryrow)
Flexible tool for adding summary rows to a data frame
# Purpose and Motivation
Reports often include tables of data. e.g.| Year | Col 2 | Col 3 |
|------|-------|-------|
| 2015 | 1 | 3 |
| 2016 | 2 | 4 |When tables are presented in reports, it is often useful to summarize columns of a table by attaching 1 or more rows to the bottom of the table. e.g. Here we attach column totals to the bottom of the previous table:
| Year | Col 2 | Col 3 |
|------|-------|-------|
| 2015 | 1 | 3 |
| 2016 | 2 | 4 |
| **Totals:** | **3** | **7** |The values 3 and 7 are the sum of the above columns. More generally, for any summary row, the value in each column is a function of some data in the original table.
When writing base R code, a non trivial amount of additional code is needed to create even a very simple summary row like the one shown above. `summaryrow`'s job is to reduce the code and time it takes to create these summary rows so you can get back to more interesting problems.
`summaryrow` also makes the code used to create summary rows easier to follow/understand by using the `magrittr::'%>%'` function to build up one or more of these summary rows.
# Installation
```R
# install package
devtools::install_github("merlinoa/summaryrow", build_vignettes = TRUE)
```# Examples
```R
library(summaryrow)
browseVignettes(package = "summaryrow")
```