Q1: The generic predict() function dispatches to a method according to class name, in this case 'usrData'. If we also had a predict.usrData1(), it would not get called. Q2: library(rectools) getInstEval() print(sum(ivl$d == 36)) Q3: 73421 X 3 Q4: meanActivity <- function(db) { tmp <- sapply(db, function(dbElement) length(dbElement$itms)) mean(tmp) } library(rectools) d <- data.frame(uID=c(1,2,1),iID=c(5,1,8),rat=c(3,3,5)) db <- formUserData(d) print(meanActivity(db)) # should be 1.5