Learning Different Functions in R