Your first example that works would just repeat the atomic vector to the
length of the row.  To replace a row with another data frame, you could use
rbind:

avGain <- rbind(avGain[-j,],b)

Or if the positioning is important,
2) avGain <- rbind(avGain[1:(j-1),],b,avGain[(j+1):nrow(avGain),])

I didn't pay close attention to how you formed b, but this of course will
only work if it has the same number of columns as avGain.

	[[alternative HTML version deleted]]


