Book Image

Building a Recommendation System with R

Book Image

Building a Recommendation System with R

Overview of this book

Table of Contents (13 chapters)
Building a Recommendation System with R
About the Authors
About the Reviewer

R package for recommendation – recommenderlab

In this chapter, we will build recommender systems using recommenderlab, which is an R package for collaborative filtering. This section will present a quick overview of this package. First, let's install it, if we haven't done so already:

if(!"recommenderlab" %in% rownames(installed.packages())){install.packages("recommenderlab")}

Now, we can load the package. Then, using the help function, we can take a look at its documentation:

help(package = "recommenderlab")

When we run the preceding command in RStudio, a help file containing some links and a list of functions will open.

The examples that you will see in this chapter contain some random components. In order to be able to reproduce the code obtaining the same output, we need to run this line:


We are now ready to start exploring recommenderlab.


Like many other R packages, recommenderlab contains some datasets that can be used to play around with the functions...