lenCheck: Check each element of a list has expected length Give a...

Description Usage Arguments Value Author(s) Examples

Description

Check each element of a list has expected length

Give a list(a, b, ...) and vector(l1, l2, ...), check that length of a is equal to l1, length of b is equal to l2, etc.

Usage

1
lenCheck(ilist, ilengths)

Arguments

ilist

list of items you want to check.

ilengths

vector of lengths for these items.

Value

TRUE or a string

Author(s)

Kaiyin Zhong, Fan Liu

Examples

1
2
3
4
5
6
7
## Not run: 
lenCheck(list(1, 2, 3), c(1, 1, 0))
grepl("\\nGiven: \n.*", lenCheck(list(1, 2, 3), c(1, 1, 0)))
grepl("\\nGiven: \n.*", lenCheck(list(1, c(1, 2, 3), list(4, 5, 6)), c(1, 1, 0))) 
lenCheck(list(1, c(1, 2, 3), list(4, 5, 6)), c(1, 3, 3))

## End(Not run)

CollapsABEL documentation built on May 1, 2019, 7:28 p.m.