The R tag on StackOverflow recently topped 1000 questions, and continues to be a great community resource for practical tips on using the R language for data analysis and visualization. To take one example, "Efficiency of operations on R data structures" has been answered with some great tips on efficiently getting data in and out of the R system. Here’s three quick tips excerpted from user "doug"’s response:
- For reading in flat files, the performance of read.table can be improved 5x (or more) just by opting out of a few of read.table’s default arguments
- With only a little more hassle, you can make reading flat files even faster by using ‘scan’ instead of ‘read.table’, and
- Paying attention to data types can often give you a performance boost and reduce your memory footprint.
See the post linked below for the complete details on how to implement these tips and power up the process of reading data into R.
StackOverflow.com: Efficiency of operations on R data structures