I'm trying to create a violin plot in ggplot with a dataframe that looks like this
Unfortunately, the violin plot doesn't seem to be calculating the values of each data point under membrane intensity, but rather the quantity of the data points in each group. At least, that's what I assume based on this image due to how similar the violins are.
Here's my code
library(tidyverse)
library(ggplot2)
library("readxl")
read_excel("C:/Users/Jacob/Desktop/School/Gatlin rotation/Data Analysis/2.24.23 ImpB - P150.xlsx")
adjIntDen <- read_excel("C:/Users/Jacob/Desktop/School/Gatlin rotation/Data Analysis/2.24.23 ImpB - P150stuff.xlsx", sheet = "Sheet2")
area <- read_excel("C:/Users/Jacob/Desktop/School/Gatlin rotation/Data Analysis/2.24.23 ImpB - P150stuff.xlsx", sheet = "Sheet3")
adjIntDen <- data.frame(adjIntDen)
colnames(adjIntDen)[1] = "Membrane Intensity"
colnames(adjIntDen)[4] = "Time(m)"
adjIntDen <- drop_na(adjIntDen)
adjIntDen$`Membrane Intensity` <- as.numeric(adjIntDen$`Membrane Intensity`)
adjIntDen <- drop_na(adjIntDen)
intDen <- ggplot(adjIntDen, aes(x="Time(m)", y="Membrane Intensity", fill = Type)) +
geom_violin(trim = FALSE)+
geom_dotplot(binaxis='y', stackdir = 'center', dotsize = 1)
intDen