When subsetting a data.frame or vector, is the same subset call guaranteed to return the same order of values/rows no matter how many times the call is made?
When subsetting a data.frame or vector, is the same subset call guaranteed to return
Share
For a vector, definitely yes. From the documentation for subset:
For data frames, the same would appear to be true, since the subsetting is just applied to each row effectively as a vector. For instance, the following will always return just entries from the
bcolumn ofdwhose correspondingavalue is greater than 5. No reordering of rows occurs.