Let me create a dummy dataset first:
Subject<- c(1, 1, 1, 1, 2, 2, 2, 2)
Sample<- c(100, 200, 300, 400, 200, 300, 400, 500)
df<-cbind.data.frame(Subject,Sample)
How would I go about finding the minimum value of the variable Sample within a given Subject value? I.e. when subject equals 1, I want to return a value of 100, while when subject equals 2, I want to return a value of 200.
Thanks all