I have a data frame with 3 columns A, B, C and I'd like to build a function to only keep rows where column A is lower to another column (could be column B or C)
I know we need to use filter_ and SE to make this possible with dplyr and I had a look at the vignette but I don't understand how it works.'
How could I transform this function into a SE function?
df = data.frame(columnA = 1:100,
columnB = rnorm(100, 50, 10),
columnC = rnorm(100, 50, 10))
fct = function(df,column_name){
df2 = df %>% filter(columnA < column)
return(df2)
}