[R-sig-Geo] Overlay a kriged interpolated output on a base map

PAMELLA KAGELIZA KILAVI pk@ge||z@ @end|ng |rom @tudent@@uonb|@@c@ke
Fri Apr 10 17:44:39 CEST 2020


 Dear All

I have been trying to overlay the output of interpolation  shown in this
link on a longlat projection in vain
https://rpubs.com/pkilavi/597291

This is an output of the ggmap data int this link
https://rpubs.com/pkilavi/597295

The algorithm below gave me some output which could only work with
continuous fill

#Convert spatial objects into data.frames for ggplot2
Krig.output=as.data.frame(s4_dose_grid)
names(Krig.output)[1:3]<-c("lon","lat","var1.pred")
ggplot(data=Krig.output,aes(x=lon,y=lat))+
  geom_tile(data=Krig.output,aes(fill=var1.pred), alpha=0.6)+
  scale_fill_gradient(high = "#0033CC", low="#cc0033")+
  coord_quickmap()

https://rpubs.com/pkilavi/597297

I converted the UTM coordinates to longlat using the code below
utmcooord-SpatialPoints(cbind(Krig.output$lon,Krig.output$lat,
Krig.output$var1.pred, Krig.output$var1.var), proj4string=CRS("+proj=utm
+zone=37 +south"))
Krig.outpt.longlat<-spTransform(utmcoor,CRS("+proj=longlat"))
Krig.output.new=as.data.frame(Krig.outpt.longlat)
names(Krig.output.new)[1:4]<-c("lon","lat","var1.pred", "var1.var")

Unfortunately, this did not work out with geom_tile and instead, I used
stat_summary_2d, which also has not worked out. I actually hoped that I
will be able to use the ggmap and have the interpolated output well placed
on a hybrid base map

Therefore, I would like to request for an assistant to help me achieve this
objective.

Thank you

Pamella Kageliza Kilavi-Ndege
Ph.D. Student
Department of Physics
University of Nairobi, Kenya

-- 

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