I want to find the max and min for each Gene in the following table. I know, that the following function gives the max (or min), but I could not manage to get both at the same time.
tapply(df$Value, df$Gene, max)
Appreciate!
Small test set:
df <- read.table(header = TRUE, text = 'Gene Value
A 12
A 10
A 123
A 1
B 3
B 5
B 6
C 1
D 3
D 45
D 98
D 234
D 4')