Select only some variables to base my analysis (without losing the other)

Hi everyone,
I need a little help with my analysis: right now my dataset is something like this

Age Gender V1 V2 C1 C2 F1 F2
20      2      1  1  2     4
23      2   1     4  3   
21      1   3  2  2     3

The most important of my variable is V# and I want to base my deleting NA process from it to create a new dataset where I will fill the missing data with mice.
My problem is that I don't know a way to select and work only with V# values without losing all the other information. In fact, I tried using select() but when I save my file I've only the V variables and nothing else.
For example, right now I need to say to r "basing only on V variables delete all row that have more then 5 missing values but keep Age, gender, C and F" and so on.
Thank you so much for your help

here I filter the iris dataset based on variables with name beginning Petal of which there are two, and I filter out all records that dont have a value over 6 in those.

iris %>% filter_at( vars(starts_with("Petal")),
                    any_vars(.>6))

Hi, thank you for your answer, I've tried using your code but it gives me back only the name variables without the data. Is there something like select() or a way to to only temporary select some variable to work with without losing the other or just added them back (edited) later?
Thank you again

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.