Learn R Programming

Kmisc (version 0.4.0-1)

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)

anatomy(df, n = 3)

Arguments

df
an object inheriting class data.frame.
n
number of elements to print from each vector.

Examples

Run this code
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 ) )
})

Run the code above in your browser using DataLab