Jaynal Abedin, Kishor Kumar Das wrote
Data Manipulation with R second edition March 2015 published by Packt Publishing.
I found the first book useful. The second edition continues to be very useful. Chapter 5 covers R and databases. The limits of using R in memory and practical ideas of workarounds to solve the problem. Like ff and filehash packages.
Chapter 4 covers the melt function in the reshape2 package.
A lot of useful information for the hard work of getting data in shape.