Custom Naive Bayes classifier using R language