setSummaries: Set summary arguments for makeDataReport

Description Usage Arguments Value See Also Examples

View source: R/setSummaries.R

Description

This function is a tool for easily specifying the summaries argument of makeDataReport. Note that all available summary function options can be inspected by calling allSummaryFunctions().

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11

Arguments

character

A character vector of function names to be used as summaries for character variables. The default options are available by calling defaultCharacterSummaries().

factor

A character vector of function names to be used as summaries for factor variables. The default options are available by calling defaultFactorSummaries().

labelled

A character vector of function names to be used as summaries for labelled variables. The default options are available by calling defaultLabelledSummaries().

haven_labelled

A character vector of function names to be used as summaries for haven_labelled variables. The default options are available by calling defaultHavenlabelledSummaries().

numeric

A character vector of function names to be used as summaries for numeric variables. The default options are available by calling defaultNumericSummaries().

integer

A character vector of function names to be used as summaries for integer variables. The default options are available by calling defaultIntegerSummaries().

logical

A character vector of function names to be used as summaries for logical variables. The default options are available by calling defaultLogicalSummaries().

Date

A character vector of function names to be used as summaries for Date variables. The default options are available by calling defaultDateSummaries().

all

A character vector of function names to be used as summaries for all variables. Note that this overrules the choices made for specific variable types by using the other arguments.

Value

A list with one entry for each data class supported by makeDataReport. Each entry then contains a character vector of function names that are to be called as summaries for that variable type.

See Also

makeDataReport, allSummaryFunctions, defaultCharacterSummaries, defaultFactorSummaries, defaultLabelledSummaries, defaultHavenlabelledSummaries, defaultNumericSummaries, defaultIntegerSummaries, defaultLogicalSummaries, defaultDateSummaries

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#Don't include central value (median/mode) summary for numerical and integer
#variables:
  setSummaries(numeric = defaultNumericSummaries(remove = "centralValue"),
    integer = defaultIntegerSummaries(remove = "centralValue"))
  
     
#Used in a call to makeDataReport():
## Not run: 
data(toyData)
makeDataReport(toyData, 
  setSummaries(numeric = defaultNumericSummaries(remove = "centralValue"),
    integer = defaultIntegerSummaries(remove = "centralValue")), replace = TRUE)

## End(Not run)
     

dataMaid documentation built on Oct. 8, 2021, 9:08 a.m.