Fixed: removed duplicate slash
Refactored R code to Google's R Style Guide
Updated includes in layout
Normalized indenting and fixed phpcs errors