2017-06-28 94 views
0

我想繪製每個日期的觀測數量。這樣我可以在觀察記錄中找到突然的高峯。我的約會看起來像這樣。我怎樣才能做到這一點?時間序列劇情觀察日期

"2016-02-19 UTC" 
"2016-02-19 UTC" 
"2016-02-19 UTC" 
"2016-02-19 UTC" 
"2016-02-20 UTC" 
"2016-02-20 UTC" 
"2016-02-20 UTC" 
"2016-02-20 UTC" 
"2016-02-20 UTC" 
"2016-02-20 UTC" 
"2016-02-21 UTC" 
"2016-02-21 UTC" 
"2016-02-22 UTC" 

回答

0

你可以只是做一個表來算觀測值的數量,然後繪製使用barplot

barplot(table(ObservationDates)) 

Barplot

數據

ObservationDates = c("2016-02-19 UTC", "2016-02-19 UTC", 
    "2016-02-19 UTC", "2016-02-19 UTC", "2016-02-20 UTC", 
    "2016-02-20 UTC", "2016-02-20 UTC", "2016-02-20 UTC", 
    "2016-02-20 UTC", "2016-02-20 UTC", "2016-02-21 UTC", 
    "2016-02-21 UTC", "2016-02-22 UTC") 
+0

尋找類似此圖(表(DF $日期)) – cappuccino

+0

這個作品的TimeSeries < - as.data.frame(不公開(表(df $ date))) TimeSeries $ Var1 < - as.Date(TimeSeries $ Var1) ggplot(TimeSeries,aes(Var1,Freq))+ geom_line(na.rm = TRUE) – cappuccino