Reputation: 5446
How I can identify if a resulting vector from one computation is full of the NA values? Thanks
Upvotes: 1
Views: 157
Reputation: 368201
Via all(is.na(x))
:
R> x1 <- 1:3
R> all(is.na(x1))
[1] FALSE
R> x2 <- x1 * NA
R> all(is.na(x2))
[1] TRUE
R>
Upvotes: 7