Hello, I was wondering whether there is a way to select random samples from a data matrix, retaining the indexing for the rows and columns? I have looked at using the sample() function. Applied directly to my matrix this returns a vector of absolute values but the indices are lost, alternatively I can select a random sample from a length equal to the number of elements in the matrix and then translate each number into an element withing the array but this seems to require a lot of work to ascertain the position and value of each element. Is there a better way of performing this operation?
Further to my earlier query I am hoping to pick a random selection of grid points (with (x,y,z) coords) from a 3d map matrix. Thanks in advance. Laura Quinn Institute of Atmospheric Science School of Earth and Environment University of Leeds Leeds LS2 9JT tel: +44 113 343 1596 fax: +44 113 343 6716 mail: [EMAIL PROTECTED] ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
