added code for *Data Mining with R* ch 3