I am trying to write a function in R to subset data based on ID in a data frame like below, but the function I wrote does not work and it doesn't give me an error message either. Can someone let me know how to fix my function code?
subset1<-function(id){df2<-df[df$ID==id,]}
dplyr::filter(df, ID == id), or usedplyr::selectto select columns,