Quick visualisation of the data:
closest_table<-plan2[,3:5]==apply(plan2[,3:5],1,min)
cols<-rep("black",nrow(plan2))
cols[closest_table[,2]]<-"red"
cols[closest_table[,3]]<-"green"
matplot(plan2[,3:10],pch=20,cex=0.4)
points(1:nrow(plan2),rep(0,nrow(plan2)),col=cols,pch="|",cex=0.5)

Edited by Christopher Porter
Quick visualisation of the data:
```
closest_table<-plan2[,3:5]==apply(plan2[,3:5],1,min)
cols<-rep("black",nrow(plan2))
cols[closest_table[,2]]<-"red"
cols[closest_table[,3]]<-"green"
matplot(plan2[,3:10],pch=20,cex=0.4)
points(1:nrow(plan2),rep(0,nrow(plan2)),col=cols,pch="|",cex=0.5)
```
