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

Description Details Author(s) See Also Examples

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.

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.

Author(s)

Brian Lee Yung Rowe <r@zatonovo.com>

See Also

anylength, anynames, anytypes

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
  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)

futile.any documentation built on May 1, 2019, 9:26 p.m.