list.util {mt}R Documentation

List Manipulation Utilities

Description

Functions to handle manipulation of list.

Usage

list2df(x)

un.list(x, y="")

shrink.list(x)

Arguments

x

A list to be manipulated.

y

A character or string of separator.

Details

list2df converts a list with components of vector to a data frame. Shorter vectors will be filled with NA. It is useful to convert rugged vectors into a data frame which can be written to an Excel file.

un.list collapses higher-depths list to 1-depth list. This function uses recursive programming skill to tackle any depths of list.

shrink.list removes all NULL or NA entries from a list.

Value

list2df returns a data frame. un.list returns a list. shrink.list retuns a list.

Author(s)

Wanchang Lin

See Also

feat.mfs

Examples

 ## See examples of function feat.mfs for the usages of list2df and un.list.
a <- list(x=1, y=NA, z=NULL)
b <- list(x=1, y=NA)
c <- list(x=1, z=NULL)

shrink.list(a)
shrink.list(b)
shrink.list(c)


[Package mt version 2.0-1.20 Index]