I am making a choropleth with ggplot and I am trying to fit the labels for my legend in the frame but R keeps putting the labeled values in scientific notation. Does anyone know of a way to address this? I have the following code which works fine when the values of my labels are smaller, but I need to include the range.
ta<- quantile(look13$capcpi,c(0, 0.2, 0.4, 0.6, 0.8, 1.0) )
t<- c('$35,141-$37,916', '$37,916-$40,236','$40,236-$43,364','$43,364-$45,280', '$45,280-$59,688')
look13$capcpi_q<- cut(look13$capcpi,ta, lables= t, include.lowest = TRUE)
lookmap<- merge(st,look13, by.x='id', by.y= 'area')
realpi<- ggplot(lookmap, aes(x=long, y=lat, group=group, fill= capcpi_q))+
geom_path() + geom_polygon(color='black')+
scale_fill_manual(values= pal)+ theme_clean()
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…