LDA as a dimensionality reducer
We can do LDA via the lda function from the MASS package. The reduced dimension data can be computed as follows:

# Model Discriminant Analysis
library( MASS )
model = lda( class ~ ., data = X_train )
# Ploting LDA Model
projected_data = as.matrix( X_train[, 1:18] ) %*% model$scaling


You can then feed the projected_data into another supervised learning method. 

Credit: The code is obtained from here.