I have a data set as I've shown below:
data <- tribble(
~cat_id, ~clicks, ~price,
"1", NA, 1.2,
"1", T, 1.4,
"1", F, 2.2,
"2", F, 2.2,
"2", T, 1.5,
"2", NA, 1.6,
"3", T, 1.7,
"3", F, 1.9,
"4", F, 1.4,
)
But now, I want to get the rows if "click" has ONLY "F" value. My desired data is like this:
desired_data <- tribble(
~cat_id, ~clicks, ~price,
"4", F, 1.4,
)
To get it, I coded like this but it did not work well:
data %>%
filter(clicks == "F"& clicks != "T"& clicks != "NA")
Do you have any idea what I am making wrong?
Thanks in advance.