Quantcast
Channel: Active questions tagged row - Stack Overflow
Viewing all articles
Browse latest Browse all 477

R: Swapping every second row in an array

$
0
0

I'm looking to swap second every row in an array. I do not know the length of the array beforehand. I do, however, know that it will be divisible by 2.

As an example:

101 102 147 148

would become

102 101 148 147

Any help would be greatly appreciated.

Thanks

Mike


Viewing all articles
Browse latest Browse all 477

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>