Stock Pattern Recognition using R