How to Check Whether the Value is NA or Not.

Suppose you have data like following. The column “Priority” has data in either “High”, “Medium”, “Low” or NA (no vaue).

Now, you want to create a new column that has TRUE if the value is NA, and FALSE if it is not NA like following.

Here is how. First, open the column header menu, and select “Mutate”.

Enter “isNA” for the column name, and type in

is.na(Priority)

in the Calculation Editor. The is.na function returns TRUE if the value is NA, and returns FALSE if not as the name explains.

Now you have a new column with TRUE/FALSE data.

If you want to have opposite values, like FALSE for NA, and TRUE for non NA values, you can add an exclamation mark (“!”) at the beginning of the formula.

!is.na(Priority)

The “!” is an operator that inverts the logical values.

Now you have a new column with TRUE/FALSE data.