I want to fill in part of an array with the values of another array. Is there anyway I can do this without looping?
e.g.
int [] [] ArrayToFillIn = new int [3] [3]
int [] FillingArray = {1, 2};
for (int i = 1; i < 3; i++)
{
ArrayToFillIn [i-1] [2] = FillingArray [i - 1];
}
in R it would be like:
ArrayToFillIn [c(1:2),3] = FillingArray []
(considering that R does not start from 0)
Thanks!
Arrays.copyOfRange, but because you're inserting across a 2D array you may not be able to leverage that without loops anyway.