I am trying to use barplot() in R studio to plot a graph to represent the average apartment price per neighbourhood (from airbnb database downloaded from internet). Thank you to another collaborator Chris Ruehlemann who suggested me below sample code. But, when I tried to run them on the large data, I cannot see properly the name of the neighbourhood on the x-axis. Does anyone has a suggestion to adjust the x-axis better so that we can see the names properly?
[barplotnoname][1]
[https://i.stack.imgur.com/PezKd.png]
Here are the code:
tmp <- data.frame(L$neighbourhood, L$price)
tmp
tmp_new <- aggregate(x = tmp$L.price, by = list(tmp$L.neighbourhood), function(x) mean(x))
tmp_new
barplot(tmp_new$x, name.arg = names(tmp_new$Group.1), main = "Avg Apt Price per Neighbourhood", xlab = "Neighbourhood", ylab = "Price")
***Before all this, need to make sure to download airbnb database from (https://plmbox.math.cnrs.fr/f/65765b530bbb4ed8b489/?dl=1). Then, load it to R studio using command: load('AirBnB.Rdata')
Please, see my previous post on this question: Using barplot in R studio