I am attempting to analyse the most expensive to least prescriptions items. There is a table named Prescription2014 that contains 21 sets of chemical groups, group ID, number of dispensed items and NET costs.
In the NET costs column, when I tried to filter it according to the value, it always sorts out alphabetically meaning 1, 2, 3, 4 format. E.g. it sorts out like 10, 200, 3, 44, however it has to be 3, 10, 44, 200.
The code that I am using is
library(ggplot2)
cc <- ggplot(prescription2014, aes(x = reorder(as.numeric(Prescription.ID),
Prescription.items.dispenses.thousands.),
y = as.character(Net.ingredient.cost.thousands.),
fill = Prescription.items.dispenses.thousands.)) + geom_bar(stat = "identity")
cc
Here, I have set Net.ingredient.cost.thousands as character because I want to show the value of the money in the graph so that the viewer can clearly see the cost of items.
Thank you