Skip to content

Flexible tool for adding summary rows to a data frame

License

Notifications You must be signed in to change notification settings

Ractuary/summaryrow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

summaryrow

Travis-CI Build Status

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

# install package
devtools::install_github("merlinoa/summaryrow", build_vignettes = TRUE)

Examples

library(summaryrow)
browseVignettes(package = "summaryrow")

About

Flexible tool for adding summary rows to a data frame

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages