These systems are used in cross-selling industries, and they measure correlated items as well as their user rate. This last point wasn’t included the apriori algorithm (or association rules), used in market basket analysis.
Here is another nice page showing a simpler case, the one known as association rules – market basket analysis: http://www.rdatamining.com/examples/association-rules
This is not related with R, but a really interesting paper about how Amazon works on item-to-item collaborative filtering: http://www.cs.umd.edu/~samir/498/Amazon-Recommendations.pdf
A really challenging objective since they process all the information on-demand to give recommendations in real time.