| sfa_itemplot | R Documentation |
A 2-D scatter of the scale's items, the embedding-space companion to
sfa_corplot: each point is an item, points are coloured by their
theoretical factor and labelled with their short code, so you can see at a
glance which items cluster together, which sit between constructs, and which
are outliers. Operates on the same (transformed) item embeddings the factor
analysis uses, or on a similarity matrix (converted to a distance).
sfa_itemplot(
x,
method = c("tsne", "umap", "pca", "mds"),
factors = NULL,
labels = NULL,
color = TRUE,
perplexity = NULL,
n_neighbors = NULL,
seed = 42,
pch = 19,
cex = 0.9,
legend = TRUE,
...
)
sfa_tsneplot(x, method = c("tsne", "umap", "pca", "mds"), ...)
x |
An |
method |
Projection: |
factors, labels |
Optional per-item factor labels and point labels
(codes). Default to those carried on |
color |
Logical; colour points by factor (default |
perplexity |
t-SNE perplexity ( |
n_neighbors |
UMAP neighbourhood size ( |
seed |
Random seed for reproducibility (t-SNE and UMAP are stochastic). |
pch, cex |
Point symbol and size. |
legend |
Logical; draw a factor legend (default |
... |
Passed to |
The projection method is selectable via method;
method = "tsne" reproduces the original behaviour. sfa_tsneplot()
is a deprecated alias kept for back-compatibility.
Invisibly, a list with the 2-D coordinates Y, the
factors, the labels, and the method used.
van der Maaten, L., & Hinton, G. (2008). Visualizing data using t-SNE. Journal of Machine Learning Research, 9, 2579–2605.
McInnes, L., Healy, J., & Melville, J. (2018). UMAP: Uniform Manifold Approximation and Projection for dimension reduction. arXiv:1802.03426.
sfa_corplot
data(big5)
fit <- sfa(
data.frame(code = big5$codes, item = big5$items,
factor = big5$factors, scoring = big5$scoring),
embeddings = big5$embeddings, scoring = big5$scoring, nfactors = 5)
sfa_itemplot(fit, method = "pca") # runnable: bundled data, base-R PCA
## Not run:
sfa_itemplot(fit) # t-SNE (default)
sfa_itemplot(fit, method = "umap") # UMAP
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.