Learn R Programming

futile.any (version 1.3.2)

futile.any-package: Futile library to provide some polymorphism

Description

This package contains a collection of utility functions that provide polymorphism over certain data types. These any* functions attempt to consolidate attribute access of lists, vectors, matrices, arrays, and other data structures.

Arguments

Details

Package:
futile.any
Type:
Package
Version:
1.3.2
Date:
2015-07-06
License:
LGPL-3
LazyLoad:
yes
The anylength and anynames functions consolidate attribute access across many data structures providing a bit of convenience via polymorphism. The anytypes function provides the classes or types of a data.frame-like object. This is useful when parsing data and it is not always clear how values will be parsed.

See Also

anylength, anynames, anytypes

Examples

Run this code
  m <- matrix(c(1,2,3,4,5,6), ncol=2)
  anylength(m)

  v <- c(1,2,3,4,5)
  anylength(v)

  m <- matrix(c(1,2,3,4,5,6), ncol=2)
  anynames(m) <- c('d','e')
  anynames(m)

  v <- c(a=1,b=2,c=3,d=4,e=5)
  anynames(v)

  l <- list(a=1,b=2,c=3,d=4,e=5)
  anynames(l)

Run the code above in your browser using DataLab