0
애니메이션에서 많은 산점도를 플롯하려고하지만 많은 플롯에서 빈 플롯 만 표시됩니다. 또한 코드를 실행하거나 범위를 조정할 때마다 다릅니다. 일부 플롯 작동합니까 그들은 모두 다음과 같이 가정된다 : ggplot2 애니메이션에 빈 플롯이 일부 표시되었습니다.
그러나 플롯의 대부분은 다음과 같이이 :
library(ggplot2)
library(animation)
begintime <- min(dfL$time)
endtime <- max(dfL$time)
beginRange <- begintime
endRange <- begintime + 10
dateRangeBetween <- function(x,y){dfL[dfL$time >= x & dfL$time <= y,]}
saveHTML({
for (i in 1:20) {
dfSub <- dateRangeBetween(beginRange, endRange)
ggScatterplot = ggplot(data = dfSub, aes(x = UTM_WGS84.Longitude, y = UTM_WGS84.Latitude)) + ggtitle("Coordinates") + xlab("Longitude") + ylab("Latitude") + theme(legend.position = "top") + geom_point()
beginRange <- beginRange + 10
endRange <- endRange + 10
print(ggScatterplot)
}
}, img.name = "coordinatesplots", imgdir = "coordinatesplots", htmlfile = "coordinatesplots.html",
outdir = getwd(), autobrowse = FALSE, ani.height = 400, ani.width = 600,
verbose = FALSE, autoplay = TRUE, title = "Coordinates")
이 내 코드입니다 내 데이터 프레임의 예 :
track time UTM_WGS84.Longitude UTM_WGS84.Latitude
1 1 2015-10-14 23:59:55.711 5.481687 51.43635
2 1 2015-10-14 23:59:55.717 5.481689 51.43635
3 1 2015-10-14 23:59:55.723 5.481689 51.43635
4 1 2015-10-14 23:59:55.730 5.481690 51.43635
5 1 2015-10-14 23:59:55.763 5.481691 51.43635
이걸 도와 줘?
감사합니다.하지만 불행히도 그렇지 않습니다. 데이터가 훨씬 크고 다른 단계를 시도했습니다. 때로는 첫 번째 작품과 중간 작품에서의 두 가지 음모, 또는 둘 다/전혀 없습니다. 그래서 그것은 정말로 무작위입니다. – Romy
데이터의 총 시간 간격은 얼마입니까? –
지금 사용하고있는 데이터 세트는 15 분 – Romy