I have multiple data frames that look this
time <- c(1,1,1,1,2,2,2,2,3,3,3,3)
ID <- c(1,2,3,4,1,2,3,4,1,2,3,4)
value <- c(0,0.1,0.2,0.4,0,0.05,0.05,0.5,0.20,0.40,0.50,0.60)
test <- data.frame(time, ID, value)
test
time ID value
1 1 1 0.00
2 1 2 0.10
3 1 3 0.20
4 1 4 0.40
5 2 1 0.00
6 2 2 0.05
7 2 3 0.05
8 2 4 0.50
9 3 1 0.20
10 3 2 0.40
11 3 3 0.50
12 3 4 0.6
I would like to be able to filter the data frame based on the values that are smaller than 0.05 in the last column.
I know I can use easily in baseR test[,ncol(test)] <0.05
is there a way that I can incorporate that in dplyr pipe or use that last_col() function
something like: test %>% filter(.,last_col()<0.05)
Any help is appreciated