Hi! I'm fairly new to R and thought this task would be simple but I'm hitting a bit of a block...
I am using a dataset on Airbnb listings in Sydney and am trying to create a barplot with the average price by neighbourhood. Here is the data:
SydneyAirbnbListings = read.csv("http://data.insideairbnb.com/australia/nsw/sydney/2019-07-10/visualisations/listings.csv", header=T)
names(SydneyAirbnbListings)
Neighbourhood = SydneyAirbnbListings$neighbourhood
Price = SydneyAirbnbListings$price
Type = SydneyAirbnbListings$room_type
The only way I can think of to do it is to break it down like this (repeating this for all neighbourhoods) and then creating the barplot by hand but I assume there has to be a much easier way to do it?:
AshfieldPrices = Price[Neighbourhood == "Ashfield"]
AuburnPrices = Price[Neighbourhood == "Auburn"]
BankstownPrices = Price[Neighbourhood == "Bankstown"]
BlacktownPrices = Price[Neighbourhood == "Blacktown"]
BotanyBayPrices = Price[Neighbourhood == "Botany Bay"]
BurwoodPrices = Price[Neighbourhood == "Burwood"]
Thanks so much in advance!!