ezPrecis: Obtain a structure summary of a given data frame

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/ezPrecis.R

Description

This function provides a structure summary of a given data frame.

Usage

1
2
3
4
ezPrecis(
    data
    , transpose = TRUE
)

Arguments

data

Data frame containing the data to be analyzed.

transpose

Logical. If TRUE (default), triggers tranposition of the resulting summary data frame (useful when there are many columns in the original data frame, leading the untransposed summary data frame to wrap).

Details

This function was inspired by the whatis() function from the YaleToolkit package.

Value

A data frame containing the descriptive information about each column in the specified data frame:

type

This row indicates the type of data R thinks is in each column. Recall that when R imports data to a data frame, each column is given a label that indicates what type of information is in that column (character, numeric, or a factor data).

missing

This row reports a count of the number of missing values in each column.

unique

This row reports a count of the number of unique values in each column.

min

This row reports the minimum value found in each column. If the column data is numeric this is straightforward. If the column data is factored, the first level is reported. If the column data is character, the alphabetically first string is reported.

max

This row reports the maximum value found in each column. If the column data is numeric this is straightforward. If the column data is factored, the last level is reported. If the column data is character, the alphabetically last string is reported.

Author(s)

Michael A. Lawrence [email protected]
Visit the ez development site at http://github.com/mike-lawrence/ez
for the bug/issue tracker and the link to the mailing list.

See Also

ezDesign

Examples

1
2
3
4
5
6
#Read in the ANT2 data (see ?ANT2).
data(ANT2)
head(ANT2)

#Show a summary of the ANT2 data.
ezPrecis(ANT2)

Example output

  subnum     group block trial     cue     flank location direction       rt
1      1 Treatment     1     1    None   Neutral       up      left 398.6773
2      1 Treatment     1     2  Center   Neutral       up      left 389.1822
3      1 Treatment     1     3  Double   Neutral       up      left 333.2186
4      1 Treatment     1     4 Spatial   Neutral       up      left 419.7640
5      1 Treatment     1     5    None Congruent       up      left 446.4754
6      1 Treatment     1     6  Center Congruent       up      left 338.9766
  error
1     0
2     0
3     0
4     0
5     0
6     0
Data frame dimensions: 5760 rows, 10 columns
             type missing values      min         max
subnum    numeric       0     20        1          20
group      factor       0      2  Control   Treatment
block     numeric       0      6        1           6
trial      factor       0     48        1          48
cue        factor       0      4     None     Spatial
flank      factor       0      3  Neutral Incongruent
location   factor       0      2     down          up
direction  factor       0      2     left       right
rt        numeric     144   5617 179.5972    657.6986
error     numeric     144      3        0           1

ez documentation built on May 29, 2017, 5:29 p.m.