list.util: List Manipulation Utilities

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Functions to handle manipulation of list.

Usage

1
2
3
4
5
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

1
2
3
4
5
6
7
8
 ## 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)

mt documentation built on Feb. 2, 2022, 1:07 a.m.

Related to list.util in mt...