I have a data table like this
ind1 ind2 ind3 indn
0.1 0.5 1.0 0.0
0.9 0.6 1.0 0.1
0.9 0.7 0.9 0.3
Each column is an individual, each row is the individuals genotype probability at that row's genome coordinate.
I want to make a single, stacked histogram where the x-axis is GP ranging from 0 to 1, and the y axis is number of sites in that range (with the stacks colored based on the individual they originated from). I previously did something like this before:
plN <- ggplot(ndf, aes(x=GP, fill=indiv, color=indiv)) + geom_histogram(binwidth = 0.01)
plot(plN)
by in that case, there were only two columns.
ind1 0.1
ind1 0.9
ind1 0.9
ind2 0.5
ind2 0.6
ind2 0.7...