0
`frequency <- gather(frequency, country, proportion, `North Korea`:`South Korea`)                                                         
ggplot(frequency, aes(x = `South Korea`, y = `North Korea`, color = difference)) +
geom_abline(color = "gray40", lty = 2) +
geom_jitter(alpha = 0.1, size = 2.5, width = 0.3, height = 0.3) +
geom_text(aes(label = word), check_overlap = TRUE, vjust = 1.5) +
scale_x_log10(labels = percent_format()) +
scale_y_log10(labels = percent_format()) +
scale_color_gradient(limits = c(0, 0.001), low = "darkslategray4", high = "gray75") +
#facet_wrap(~country, ncol = 2) +
theme(legend.position="none") +
labs(y = "North Korea proportion", x = "South Korea proportion")`

I am trying to output a scatterplot comparing word frequencies between South Korea and North Korea. However, I keep getting the error: Error in percent_format() : could not find function "percent_format." The scatterplot displays correctly when I do not use the percent_format function, however it does not display the commonly used words and their proportions as I had hoped. The code I am using is taken from chapter 1, section 5 of tidytextmining.com. I am using the ggplot package to display the scatterplot. Thanks!

0 Answers0