I have a dataset that shows the human chromosomes with their length (which is here named "value") and their respective genes. Furthermore the genes are divided in 4 groups (gtype) which are RNA, prot-coding, pseudogene and rest. I want to plot the individual chromosomes on the y axis and on the x axis I want to have the density of the chromosomes (which would be "the number of genes per chromosome" divided by the length of the chromosome)with a geom_point,bar or col, then make a facet_wrap based on the gtype of the genes. So 4 plots with one plot only counting RNA genes divided by the value, one plot ony counting the prot-coding genes divided by value.
The plot just divides the total number of all genes by the individual values (it is however normal that chrM would be the biggest)
However I constantly fail at the x axis and I don't know how to get a plot that makes sense. What I have tried so far is a mix of sum(), count(), nrow() and group_by(). Often the x axis is just the total numbers of rows divided by the "value" or the results don't make sense.