ismissing(x) where x is REAL, LOGICAL or CHARACTER or a structure all of whose components are REAL, LOGICAL, or CHARACTER |

ismissing(x) returns a LOGICAL variable (with the same shape as x) which is True where x is MISSING and False where x is not MISSING. x must be a vector, matrix, or array. If x is a CHARACTER variable, an empty string ("") is considered to be a missing value. If x is a NULL variable, ismissing(x) is NULL. See topic 'NULL'. It is also acceptable for x to be a structure, whose non-structure components are vectors, matrices or arrays. In that case, ismissing() returns a structure of the same form, each of whose non-structure components is the result of applying ismissing() to the corresponding component of x. ismissing(x) has the same labels as x, if any. Examples: ismissing(vector(1, 3, ?, 7)) and ismissing(vector("A","B","","Z")) both return vector(F, F, T, F) x[vector(ismissing(x))] <- -1 replaces all MISSING values in x by -1. sum(vector(ismissing(x))) returns the number of MISSING values in x, whether x is a vector, matrix, array, or structure. See also anymissing(), sum().

Gary Oehlert 2003-01-15