library(data.table)
library(ggplot2)
library(gganimate)
df <- data.table(readRDS('flats.rds'))
# colors that I used "#006D77", "#66B7B0" ,"#EDF6F9"Reproduce the below plots:
Task 1
Task 2
Task 3
## `geom_smooth()` using formula 'y ~ x'
Task 4
Task 5
Task 6
Task 7
Bonus exercises
Geocode the (center of the) 23 districts in Budapest (like we did in the class this week), and show the distribution of comfort level for each district on a map. Yeah, using pie charts via scatterpie! You can use get_stamenmap from the ggmap package to grab the background raster image:
Now use the location data from above, but instead of points, place small pie-charts (!) on the map to show the distribution of comfort level for each district. You might need to pivot your long table into a wide one using dcast. Don’t forget to order the labels of Comfort_lev first:
Note, that the echo = FALSE parameter was added to the above code chunks to prevent printing of the R code that generated the plot … but you should not do that, as we want to see how you solved the exercise.