I have this plot in R
, which is currently unordered. How can I automatically order the plot by gene density without having to specify the order manually? Is there a command to do that?
species_name <- c("hepatitis D","HIV-1","influenza A","pandoravirus")
species_name
genome_size <- c(1.7, 9.7, 14, 2800)
genome_size
gene_counts <- c(1,9,11 ,2500)
gene_counts
gene_density = gene_counts / (genome_size/1000)
gene_density
expn <- data.frame (species_name, genome_size, gene_counts, gene_density)
barplot(gene_density ,names.arg=species_name,ylim=c(0,1000),xlab="species_name",ylab="gene_density",col="coral",main="Gene Density",border="coral2")