Created
December 2, 2020 22:13
-
-
Save alexpghayes/4fa3ff7f782ad7a6b011a902f42e84ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(scales) | |
y_long <- fa %>% | |
get_varimax_y() %>% | |
pivot_longer( | |
names_to = "factor", | |
cols = contains("y"), | |
values_to = "loading" | |
) | |
trans_symlog <- trans_new( | |
name = "symlog", | |
transform = function(x) log10(abs(x) + 1) * sign(x), | |
inverse = function(x) abs(10^x - 1) * sign(x) | |
) | |
y_long %>% | |
ggplot(aes(loading)) + | |
geom_histogram(bins = 30) + | |
scale_x_continuous(trans = trans_symlog) + | |
scale_y_log10() + | |
facet_wrap(vars(factor)) + | |
theme_minimal() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment