I have a dataframe that looks like that:
A B C
0,868385346 0,628248588 0,468926554
0,074626866 0,277966102 0,271186441
0,024423338 0,057627119 0,203389831
0,017639077 0,007909605 0,011299435
0,004070556 0,007909605 0,011299435
0,004070556 0,005649718 0,011299435
0,002713704 0,003389831 0,005649718
0,001356852 0,001129944 0,005649718
0,001356852 0,001129944 0,005649718
0,001356852 0,001129944 0,005649718
0,001129944
0,001129944
0,001129944
0,001129944
0,001129944
0,001129944
0,001129944
These are proportions of compositions of A, B and C (the numbers add to 1, with the highest figure at the top)
I want to make a bar chart with A, B, C on the x axis (or faceted but I'll see that later), and for each, a bar that shows the actual data (so for A, ten bars showing the proportions, the first being 0.86, the second 0.07, etc.) in order to compare the different distribution within the composition.
ggplot documentation states: "If you want the heights of the bars to represent values in the data, use geom_col instead" which is exactly what I want.
I run the following with na.omit since the different columns have a different number of rows
ggplot(na.omit(data)) + geom_col()
I get the following error: Error in pmin(y, 0) : object 'y' not found
I see that I have to assign a y (in the geom_bar documentation since it seems geom_col has no documentation of its own). I tried various things to get a scale from 0 to 1, such as y=c(0:1), but nothing seems to be working.
I still don't understand how to assign a y axis while the function geom_col says it makes the height of the bar from the data...
I am obviously missing something basic here, so any pointers would be appreciated.