# bâtons par fréquence du type de location barplot(table(flats$room_type)) # bâtons horizontaux barplot(table(flats$room_type), horiz=TRUE) # en écrivant les graduations d’axes à l’horizontale par(las=1) barplot(table(flats$tranche_prix)) # barres empilées barplot(table(flats$room_type, flats$tranche_prix)) # avec une légende barplot(table(flats$room_type, flats$tranche_prix), legend=TRUE) # en fixant les couleurs barplot(table(flats$room_type, flats$tranche_prix), legend=TRUE, col=c(« green », »purple », »orange »)) library(viridis) # palettes de couleurs barplot(table(flats$room_type, flats$tranche_prix), legend=TRUE, col=magma(3)) # 3 parce qu’il faut 3 couleurs # en ajustant les marges (bas, gauche, haut, droite) par(mar=c(3,10,1,3)) barplot(table(flats$neighbourhood_cleansed), horiz=TRUE) # pour ordonner les barres, il […]