Hello research community members who are using R!
If I may ask for your support in a simple question that I am stuck with.
I have a data.frame
with the following structure:
Date | CountryName | Variable 2 | Variable 3 |
---|
I need somehow to get a data.frame
that contains all records for specific Country_1
, based upon condition that Variable 3
== NA.
In other words, if a record contains NA in Variable 3
for Country_1
then the output would return all records for this Country_1
in this data set. The same condition is expected to be applied to all records in this data set so that, at the end, I've got a data.frame
of all records of Country_1
... Country_N
provided that there is at least one NA in Variable 3
for these countries. Those countries whose records don't contain NAs in Variable 3
have not been included in the output.
I tried using if_else
condition, but it didn't work out, so due to limited functional programming skills I decided to post this question here.
Thanks a lot.