is_valid: Test if object is valid

Description Usage Arguments Examples

View source: R/is_valid.R

Description

Test for nchars() or nrows() of object. For lists, returns TRUE if at least one member of the list passes validity test. NA objects return FALSE.

Usage

1
is_valid(x, n = 1)

Arguments

x

Object for length test.

n

Minimum number of characters if character or numeric; Minimum number of rows if data frame.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# For a character string
is_valid("MyName", n = 3)

is_valid(as.character(NA), n = 1)

# For a data frame
is_valid(data.frame(X = 1), n = 1)

is_valid(data.frame(X = 1), n = 2)

# For numeric
is_valid(13, n = 2)

# For a list
is_valid(list(NA, "MyName"), n = 3)

dKvale/aermod documentation built on Jan. 28, 2018, 3:47 a.m.