Last data update: 2014.03.03

R: Show the types of a list or data.frame
anytypesR Documentation

Show the types of a list or data.frame

Description

This function shows the types of the columns in a data.frame or the elements of a list.

Arguments

data

A data.frame

fn

The function used to get the types. Defaults to class, although type or mode, etc. could be used

Value

A vector containing the types of the columns of a data structure

Usage

anytypes(data, fn) anytypes(data, fn=class)

anytypes(data, fn) anytypes(data, fn=class)

Details

This is a convenience function to see the types associated with the elements of a list or the columns of a data.frame.

Author(s)

Brian Lee Yung Rowe

Examples

x <- data.frame(ints=1:3, chars=c('a','b','c'), nums=c(.1,.2,.3))
anytypes(x)

x <- list(ints=1:4, chars=c('a','b','c'), nums=c(.1,.2,.3))
anytypes(x)

Results