So I have a data frame that has all the information from climate_extremes.RData along with the city and country name, no. population, latitude , longitude (from packages 'maps', data (world.cities) ) All of it it's joined, everything good.
In the first bit of code I wanted to have a world map with all the cities as dots.
My problem comes on the second part where I had tried to have every city dot coloured according by the wsdi values. At the same time the city has to be grouped based on scenario and year.
I do not really understand why I get this error when everything is specified in the code? I am quite new to R and trying to learn it through a platform but ... yeah.
Error in check_aesthetics():
! Aesthetics must be either length 1 or the same as the data (939): x and y
After that select(city) step, the only column in the data frame will be city, yet the ggplot code that follows tries to use the columns lon and lat. Why are you selecting only the city column?
Oh. You're right.. that happens when you copy paste an example code online.
I tried to select Lon and Lat as well, but I get the same error.
Do I even need to use the select? Seems everything I do I get the same result..Maybe there is a problem with how tidy my data is? How can I find out
Neither the select() nor the group_by() make sense to me. Also, you use fill = wsdi outside of the aes() function. Since wsdi is a column in your data, I don't think that is correct. Try