complete_cases_array is generalization of complete_cases to arrays. any_cases_array tests for any non-NA rather than all non-NA along margin.

any_cases_array(a, margin = 1)

all_cases_array(a, margin = 1)

Arguments

a

multidimensional array

margin

margins to test along

Value

matrix

Examples

a <- array(0, dim =c(3,4,2)) a[2,2,] <- NA any_cases_array(a, margin=1)
#> [1] TRUE TRUE TRUE
any_cases_array(a, margin=c(1,2))
#> [,1] [,2] [,3] [,4] #> [1,] TRUE TRUE TRUE TRUE #> [2,] TRUE FALSE TRUE TRUE #> [3,] TRUE TRUE TRUE TRUE
all_cases_array(a, margin=1)
#> [1] TRUE FALSE TRUE
all_cases_array(a, margin=c(1,2))
#> [,1] [,2] [,3] [,4] #> [1,] TRUE TRUE TRUE TRUE #> [2,] TRUE FALSE TRUE TRUE #> [3,] TRUE TRUE TRUE TRUE