I want to make a subset of my data, by selecting columns, like below:
select(df, col1, col2, col3, col4)
But sometimes I have a slightly different data set, with only col1, col2 and col4.
How can I use select(), and If a column doesn't exist, it just continues without giving an error?
So it would give a dataset with col1, col2 and col4 (and skip col3). If I just run the above select() line, I get this error:
Error in overscope_eval_next(overscope, expr) : object 'col3' not found