Ok, I'm pretty new to R, and I tried to find documentation on what I needed to do, but here is the problem.
I have a data.frame called heeds.data in the following form (some columns are omitted for simplicity) eval.num, eval.count, ... fitness, fitness.mean, green.h.0, green.v.0, offset.0, green.h.1, green.v.1, ... green. h.7, green.v.7, offset.7 ...
And I selected a line that meets the following criteria:
best.fitness <- min(heeds.data$fitness.mean[heeds.data$eval.count >= 10])
best.row <- heeds.data[heeds.data$fitness.mean == best.fitness]
Now I want all other rows to have green.h.0 and offset.7 columns (adjacent column section) equal to best.row
I thought it might work
heeds.best <- heeds.data$fitness[
heeds.data$green.h.0 == best.row$green.h.0 & ...
]
But with 24 columns, this seems like a dumb method. Looking for something simpler with less manual tuning.
Here is a brief sample of data to show what I want
eval.num, eval.count, fitness, fitness.mean, green.h.0, green.v.0, offset.0
1 1 1500 1500 100 120 40
2 2 1000 1250 100 120 40
3 3 1250 1250 100 120 40
4 4 1000 1187.5 100 120 40
5 1 2000 2000 200 100 40
6 1 3000 3000 150 90 10
7 1 2000 2000 90 90 100
8 2 1800 1900 90 90 100
"" 4
eval.num, eval.count, fitness, fitness.mean, green.h.0, green.v.0, offset.0
1 1 1500 1500 100 120 40
2 2 1000 1250 100 120 40
3 3 1250 1250 100 120 40
4 4 1000 1187.5 100 120 40
, ,
!