Learn R Programming

Kmisc (version 0.5.0)

anat: Display the Anatomy of a Data Frame

Description

This function displays the 'anatomy' of a data frame. In practice, it's used to implement a faster version of str for data frames built entirely of atomic vectors, as str.data.frame is very slow for large data frames. If there are non-atomic vectors in df, we fall back to base::str.

Usage

anat(df, n = 3, cols = 99)
anatomy(df, n = 3, cols = 99)

Arguments

df
An object inheriting class data.frame.
n
The number of elements to print from each vector.
cols
The number of columns to print from the data.frame.

Examples

Run this code
## Not run: 
# local({
#   bigDF <- as.data.frame( matrix( factor(1:1E3), nrow=1E3, ncol=1E3 ) )
#   sink( tmp <- tempfile() )
#   str <- system.time( str(bigDF, list.len=1E3) )
#   anat <- system.time( anat(bigDF) )
#   sink()
#   unlink(tmp)
#   print( rbind( str, anat ) )
# })
# ## End(Not run)

Run the code above in your browser using DataLab