attribute_summary: Get data frame summary statistics for one or all columns of a...

Description Usage Arguments Value Examples

View source: R/extradplyr.R

Description

generate summary for a given attribute grouped by a target attribute

Usage

1
2
3
4
5
6
attribute_summary(
  data,
  summary_attr = NULL,
  group_attr = NULL,
  .checkAssertions = TRUE
)

Arguments

data

a data frame or tibble type object

summary_attr

a column label as a string to summarize

group_attr

a column label to group by before summarizing (optional)

.checkAssertions

private variable used to check function assertions (if first in chain)

Value

a list containing a summary table for all attributes or the specified summary_attr (if present), grouped by the group_attr (if present)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# summarise all columns
attribute_summary(iris)

# summarise only 'Petal.Length'
attribute_summary(iris, summary_attr='Petal.Length')

# summarise 'Petal.Length' grouped by 'Species'
attribute_summary(iris, summary_attr='Petal.Length', group_attr='Species')

# summarise all columns grouped by 'Species'
attribute_summary(iris, group_attr='Species')

duncankmckinnon/OKdplyr documentation built on Nov. 30, 2020, 1:13 a.m.