我在用ggflags作图,但是一直出现warning messages. 谷歌了后几乎都是不外乎两种说法:一种说是我的数据里有NA,要么就是说和y/xlim 有关系。 但是我两种都试过了结果还是没有用。下面的就是我得到的提示。
Warning message:
Removed 109 rows containing missing values (geom_flag).
下面的是我的code,能有人能帮我看一下看看哪里出问题了吗?
library(ggflags)
forRegions <- read_excel("180810_60 CountriesByRegion_EpiSdgi.xlsx",
sheet = "duplicate")
forRegions<- forRegions[,c(1:3)] #extract first 3 columns
oce0101 <- read_excel("EPI Analysis.xlsx", sheet = "EPI duplicate")
oce0102<- oce0101[,c(2,3,23)] #extract mpa index column
oce0103<- merge(oce0102,forRegions,by= 'iso') #to include regions
df=data.frame(oce0103)
library(countrycode)
code=countrycode(df$country,"country.name","iso2c")
df$country=sample(c(code))
#df[df==0]=NA
#na.omit(df)
df <- na.omit(df)
ggplot(df,aes(x=Region,y=MPA.current,country=country))+
geom_flag(aes())+
scale_x_discrete(limits =c(0,100))+
scale_y_continuous(limits =c(0,110))