How to plot MASS:qda scores
<p>From <a href="https://stackoverflow.com/questions/12495676/access-scores-for-observation-on-linear-discriminants-in-lda-using-masslda">this question</a>, I was wondering if it's possible to extract the Quadratic discriminant analysis (QDA's) scores and reuse them after like PCA scores. </p>

<pre><code>## follow example from ?lda
Iris &lt;- data.frame(rbind(iris3[,,1], iris3[,,2], iris3[,,3]),
                   Sp = rep(c("s","c","v"), rep(50,3)))
set.seed(1) ## remove this line if you want it to be pseudo random
train &lt;- sample(1:150, 75)
table(Iris$Sp[train])
## your answer may differ
##  c  s  v
## 22 23 30
</code></pre>

<p>Using the QDA here</p>

<pre><code>z &lt;- qda(Sp ~ ., Iris, prior = c(1,1,1)/3, subset = train)

## get the whole prediction object
pred &lt;- predict(z)
## show first few sample scores on LDs
</code></pre>

<p>Here, you can see that it's not working. </p>

<pre><code>head(pred$x)
# NULL
plot(LD2 ~ LD1, data = pred$x)
# Error in eval(expr, envir, enclos) : object 'LD2' not found
</code></pre>