R is quite slow, but there are two ways to improve this state of affairs.
1. Use the functional style stuff rather than loops ( i.e. especially the apply family of functions)
2. For large data sets avoid the default memory management which involves loading everything into memory all at once. The sqlite dataframe stuff is probably a good default for larger data sets :)
It's still slow though.