Skip to content

Instantly share code, notes, and snippets.

@alexpghayes
Created December 2, 2020 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexpghayes/4fa3ff7f782ad7a6b011a902f42e84ba to your computer and use it in GitHub Desktop.
Save alexpghayes/4fa3ff7f782ad7a6b011a902f42e84ba to your computer and use it in GitHub Desktop.
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