Hello,
I have to do some statistics on a world map with R but I am a beginner on this software. I tried to find out by myself (on internet) where this error message could come from : I think I misunderstand how scatterplot works or maybe my data is incorrectly formatted. I am posting various screenshots here. Thanks for your help and patience.
Code :
geodata <-read.table('R_Data_Map_Chrm3.tsv',sep="\t")
geodata2.0 <-geodata[,-9]
names(geodata2.0)[1]<-"long"
names(geodata2.0)[2]<-"lat"
names(geodata2.0)[3]<-"antibiotic target replacement"
names(geodata2.0)[4]<-"antibiotic efflux"
names(geodata2.0)[5]<-"antibiotic inactivation"
names(geodata2.0)[6]<-"antibiotic efflux reduced permeability to antibiotic"
names(geodata2.0)[7]<-"antibiotic target protection"
names(geodata2.0)[8]<-"antibiotic target alteration"
geo <- map_data("world")
ggplot() + geom_polygon(data = geo, aes(x = long, y = lat, group = group), colour = "grey", fill = "white") + geom_scatterpie(data = geodata2.0, aes(x=long, y=lat), cols = c("antibiotic target replacement","antibiotic efflux","antibiotic inactivation","antibiotic efflux reduced permeability to antibiotic","antibiotic target protection","antibiotic target alteration"))
Results : Warning message : Removed 294 rows containing non-finite values (stat_pie).