psych - Getting factor loadings as data.frame for LaTeX export
When you look at fac$loading
, you see that it is a S3 object. Removing the class attribute gives you a matrix
which can then be passed to xtable
:
str(fac$loadings)
class(fac$loadings)
xtable(unclass(fac$loadings))
That works fine.
An alternative is to use the fa2latex function in psych:
Using your example:
library(psych)
fac <- fa(bfi,5)
fa2latex(fac)
will give you an APA ready LaTeX table.
Bill