The purpose of moodler is to easily get data from Moodle database and format it for further analysis.
You can install moodler from github with:
# install.packages("devtools")
devtools::install_github("jchrom/moodler")
# Create a database connection
con = DBI::dbConnect(RMySQL::MySQL())
# Get a course list
courses = get_courses(con)
# Get specific modules
modules = get_course_modules(con, course.id = 2, module.type = c("quiz", "forum"))