I am trying to add a marginal density plot for a ggplot object, denoted by g in the next script:
ggplot
g
library(tidyr) library(ggplot2) library