Quantcast
Viewing latest article 3
Browse Latest Browse All 9

Answer by Nathan Werth for R: Swap two variables without using a third

The good thing about having way too many functions in the base package: there's always a way to do something, even if it's a bad idea.

list2env(list(a = b, b = a), envir = .GlobalEnv)

This works no matter what the classes of a and b are. But I repeat: this is a bad idea.


Viewing latest article 3
Browse Latest Browse All 9

Trending Articles



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