I learn by example so because I haven\'t seen a example yet on how to solve this problem so I am asking.
This is in R.
So lets say I make a matrix below.