The following video by Jared Lander shows how you can use the Rcpp package to take advantage of C++ classes and R functions.
Watch the Using Rcpp Syntactic Sugar video.
This video excerpt is from Advanced R LiveLessons: Tools for Greater Productivity and Machine Learning published by Pearson/Addison-Wesley Professional.
By Jared Lander