I am trying to create a violin plot with genotype on the x axis and age on the y axis.
My data.frame (df1) looks like this:
ID 1kbDel 3kbDel Age
1 WT Homo 40
2 Het WT 30
3 Homo Het 60
I tried:
ggplot(df1, aes(x='1kbDel', y=Age)) + geom_violin(trim=FALSE)
Where I also changed the values of age, 1kbDel, and 3kbDel to factors. But instead of creating a plot with 3 violins (WT, Het, Homo), it creates one labeled '1kb'
I also tried changed Wt, Het, Homo to 0, 1, 2 but I get the same behavior, I dont know why
question from:
https://stackoverflow.com/questions/65545971/ggplot-not-seperating-by-value-calling-variables-that-start-with-numbers 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…