2017-07-31 2 views
-1

gganimateを使用してマップ上にグラフをアニメーション表示しようとしています。しかしそれは働かない。それに代わるものはありません。あるいは、私はgganimateを実装する間違いをしています。マップをアニメーション化することが可能であれば、私のコードを吟味してください。gganimateの代用品です。または解決のアニメーショングラフへ

setwd("E:\\earthquake-database") 
dataset=read.csv("database.csv") 

library(plyr) 
library(dplyr) 
library(ggmap) 
library(ggplot2) 
library(animation) 

eq=read.csv("database.csv", stringsAsFactors = F) 
names(eq) 

eq = eq %>% 
    filter(Magnitude > 7) 
eq$Date <-as.character(eq$Date) 
list<-strsplit(eq$Date,"/") 
eq_Date1<-ldply(list) 
colnames(eq_Date1)<-c("Day","Month","Year") 
eq_Date1 

## Column bind with the main dataframe 
eq<-cbind(eq,eq_Date1) 
names(eq) 
eq$Year<-as.numeric(eq$Year) 

## Get the world map for plot and load the necessary package 
world<-map_data("world") 
world <- world[world$region != "Antarctica",] 
names(world) 


map<-ggplot()+geom_map(data=world, 
         map=world,aes(x=long,y=lat, 
            map_id=region),color='#333300',fill='#663300') 

p <- map + geom_point(data = eq, aes(x = Longitude, y = Latitude, 
            frame = Year, 
            cumulative = TRUE,size=EQ$Magnitude), alpha = 0.3, 
         size = 2.5,color="#FF0000")+ 
    geom_jitter(width = 0.1) +labs(title = "Earthquake above 7 point on richter scale")+theme_void() 



library(gganimate) # its not working 

devtools::install_github("dgrtwo/gganimate") # it is also not working 
nter code here 

答えて

0

私はちょうど おかげで私

のために働いて

library(devtools) 
install.packages(“Rcpp”) 
devtools::install_github("dgrtwo/gganimate") 
library(gganimate) 

その答えを見つけました

関連する問題