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]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to