A variational Bayes latent class approach for EHR-based patient phenotyping in R