Learn R Programming

tester (version 0.2.0)

list_with_vectors: List with vectors

Description

list_with_vectors checks if an object is a list with vectors
list_with_numeric_vectors checks if an object is a list with numeric vectors
list_with_string_vectors checks if an object is a list with string vectors

Arguments

x

an R object

See Also

is_vector, list_of_vectors

Examples

Run this code
a = list(1:3, letters[1:3], c(exp(1), pi), NA)
b = list(1:3, c(exp(1), pi))
d = list(letters[1:3], 'bonjour a tous')
e = list(matrix(1:6, 2, 3), a, b)

list_with_vectors(1:10) # FALSE
list_with_vectors(b) # TRUE
list_with_vectors(d) # TRUE

list_with_numeric_vectors(a) # TRUE
list_with_numeric_vectors(b) # TRUE
list_with_string_vectors(d) # FALSE

list_with_string_vectors(a) # TRUE
list_with_string_vectors(d) # TRUE
list_with_string_vectors(b) # FALSE

Run the code above in your browser using DataLab