 . Commander is available in 3 different versions as an official game pack, or you can use the crack offline version.Q:

Is it possible to select rows based on the minimum difference in values between two columns?

I have a dataset with two columns: x, y, and would like to subset based on those two columns having the minimum difference between the two columns.
Example:
x1 y1 x2 y2 x3 y3 x4 y4
aa 12 bc bb 16 ac 12
aa 12 ac bb 16 12 ac
aa 12 ac bc bb 16 12
aa 12 ac bb 16 ac 12
aa 12 bc bb 16 12 ac
aa 12 bc bb 16 12 ac

So I’d like to get:
aa 12 bc bb 16 ac 12
aa 12 ac bc bb 16 12

i.e. it would select rows where x1-x2 < x2-x1 and y1-y2 < y2-y1. A: My guess would be that you want to select rows that have the minimum difference for the two columns being compared. So if you start with your data frame and create a new data frame with the row names of your data frame, then the first step will be to create a vector containing the minimum difference for each row. df <- data.frame(x1=c("aa", "aa", "aa"), x2=c("bc", "ac", "ac"), y1=c(12, 12, 12), y2=c(16, 16, 16), y3=c(12, 12, 12), y4=c(12, 12, 12)) df\$diffs <- c(df\$x1 - df\$x2, df\$x2 - df\$x1, df\$y1 - df\$y2, df\$y2 - df\$y1) df[df\$diffs == min(df\$diffs),] I'm not sure how well this answers your questions, but at least

0644bf28c6