[R-sig-Geo] creating a data range for color coding and using it in color_manual_scale

PAMELLA KAGELIZA KILAVI pk@ge||z@ @end|ng |rom @tudent@@uonb|@@c@ke
Thu Mar 26 15:52:18 CET 2020


 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]]



More information about the R-sig-Geo mailing list