Hi - I'm trying to plot a simple ranking plot using countries and overall ranking, but I would like to be able to filter the plot by year and export it to Power BI. The only reason why I'm not doing this directly into Power Bi is that the visual gives the impression that a higher ranking is bad and a lower ranking is good since it is a higher number and I don't want to do the whole multiply by -1 hack. I'm just trying to figure out what the best way to do this would be. But even just plotting all years is causing errors.
R code here
x<-dataset$Country
y1<-dataset$Global Rank in the WJP Rule of Law Index
y2<-dataset$Reporting Period (year of collection)
ggplot(dataset,aes(x,y1))+geom_bar(stat="identity",fill="blue")+
theme_bw()+
Error: Aesthetics must be either length 1 or the same as the data (336): x and y
Thanks