How to filter by missing data

Welcome to RStudio Community!

Can you give us an example of your dataset sonadata? If you have NA values in Last_name, your first code attempt should return a new set of data containing only the rows with missing values for that variable. If that's not working and you know there are missing values in that variable then I'm guessing the missing values aren't being recognized as NA by R.

It will help to give us a reproducible example (aka reprex). There's some good information on how to get started with making a reproducible example here:

1 Like