You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
library(psych)
library(ggplot2)
#> #> Attaching package: 'ggplot2'#> The following objects are masked from 'package:psych':#> #> %+%, alpha
library(dplyr)
#> #> Attaching package: 'dplyr'#> The following objects are masked from 'package:stats':#> #> filter, lag#> The following objects are masked from 'package:base':#> #> intersect, setdiff, setequal, union
library(tidyr)
library(ggbeeswarm)
set.seed(352)
bfi %>%
select(starts_with("O")) %>%
pivot_longer(cols= everything(), names_to="facet", values_to="rating") %>%
slice(sample(1:nrow(.), size=200)) %>%
ggplot(aes(x=facet, y=rating)) +
geom_beeswarm()
In use cases such as the above plot, it would be cool to be able to vertically jitter the points slightly to get a sense of the Ns of each rating level. Unless there is a way to do this that I missed!
The text was updated successfully, but these errors were encountered:
mvanaman
changed the title
Option to vertical jitter?
Feature Request: Option to vertical jitter?
Dec 17, 2023
Hi @mvanaman, you can do this two ways without using ggbeeswarm . The first is to add jitter manually to the dataframe prior to ggplot- this has the benefit of letting you group the variables with dplyr so the jitter amount is correct. The other way to do it is to simply call jitter() in the aes() argument for your plot, though this ignores any grouping so you'd probably want to manually tune the jitter(amount=...) argument.
Created on 2023-12-17 with reprex v2.0.2
In use cases such as the above plot, it would be cool to be able to vertically jitter the points slightly to get a sense of the Ns of each rating level. Unless there is a way to do this that I missed!
The text was updated successfully, but these errors were encountered: