creating a data range for color coding and using it in color_manual_scale

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

creating a data range for color coding and using it in color_manual_scale

PAMELLA KAGELIZA KILAVI
 Dear All

I have been able to move one step forward but still haven't been able to
assign the correct color to the levels created

The r-code is as below with the output  in the url
I assigned Blue, green, yellow, orange and red to the different levels.
Unfortunately, the output is not as expected.

#create the five levels
Mrima_levels<-cut(Mrima_sf$dose,breaks=c(0,114,228,570,2293,5144))

#assign color code to the levels
palette=c(Mrima_levels, seecol(pal_signal,n=5))

#Use the five levels and palette created to create a discrete map
ggplot(Mrima, mapping=aes(x=lon,y=lat))+geom_sf(data=Mrima_sf, inherit.aes
= FALSE)+
  geom_point(aes(colour=Mrima_levels),alpha=0.6, size=1)+
  scale_color_manual(values=palette, aesthetics =c("colours", "fill") ,
breaks=waiver())+
ylab("Latitude")+xlab("Longitude")

https://rpubs.com/pkageliza/589877

Kindly assist
Thank you

--

The University of Nairobi is ISO 9001:2015 certified.
Website:
http://www.uonbi.ac.ke/ <http://www.uonbi.ac.ke/>
Facebook:
https://www.facebook.com/uonbi.ac.ke <https://www.facebook.com/uonbi.ac.ke>

Twitter: @uonbi¬† https://twitter.com/uonb <https://twitter.com/uonb>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo