Learn R Programming

lambda.tools (version 1.0.9)

anytypes: 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.

Examples

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

Run the code above in your browser using DataLab