naivebayes is an efficient implementation of the Naive Bayes algorithm in R.
install.packages("naivebayes")
# Or the the development version from GitHub:
devtools::install_github("majkamichal/naivebayes")
library(naivebayes)
data(iris)
nb <- naive_bayes(Species ~ ., data = iris)
tables(nb, which = "Sepal.Length")
#> $Sepal.Length
#>
#> Sepal.Length setosa versicolor virginica
#> mean 5.0060000 5.9360000 6.5880000
#> sd 0.3524897 0.5161711 0.6358796
plot(nb, which = "Sepal.Length")
head(predict(nb))
#> [1] setosa setosa setosa setosa setosa setosa
#> Levels: setosa versicolor virginica