我正试图更加熟悉gganimate
软件包。这样做时,我注意到transition_time(time)
似乎不一定使用time
中的确切值,而是进行了填充。在下面的data.frame
中,{{1 }}变量。据我了解,我希望time
仅在这41个日期之间过渡。
在下面的代码中,我还使用transition_time(time)
根据geom_rect
中的值为背景着色。查看输出的category
,当背景为白色时,df.gif
似乎使用的值transition_time(time)
尚无实际观察值。此外,在某些情况下,观察值似乎是“推算”的,即,在实际观察值之间存在过渡,并且在多个观察步骤之间没有观察值。
也许这不是问题,但是由于我缺乏对它实际工作方式的理解。无论如何,任何指针都非常感谢,谢谢!
time
df <- structure(list(time = structure(c(12174, 12179, 12180, 12181,
12189, 12191, 12193, 12198, 12199, 12200, 12201, 12202, 12203,
12205, 12206, 12207, 12208, 12209, 12210, 12211, 12212, 12213,
12214, 12215, 12216, 12217, 12218, 12219, 12220, 12221, 12222,
12223, 12224, 12225, 12226, 12227, 12228, 12229, 12230, 12231,
12232), class = "Date"), lon = c(37.0615319203799, 37.0716477974754,
37.0615319203799, 37.0923434723092, 37.0923434723092, 37.0507170659893,
37.1042645986751, 37.1042645986751, 37.0716477974754, 37.0507170659893,
37.0507170659893, 37.0923434723092, 37.0716477974754, 37.047738185691,
37.0906383964751, 37.066505639265, 37.1069135660838, 37.0808814378127,
37.066505639265, 37.0808814378127, 37.1069135660838, 37.066505639265,
37.1069135660838, 37.0906383964751, 37.047738185691, 37.1069135660838,
37.1069135660838, 37.0808814378127, 37.066505639265, 37.0808814378127,
37.047738185691, 37.066505639265, 37.0906383964751, 37.047738185691,
37.1069135660838, 37.0808814378127, 37.066505639265, 37.0906383964751,
37.066505639265, 37.0906383964751, 37.0808814378127), lat = c(-2.7411848459376,
-2.71292701762913, -2.7411848459376, -2.72165547518141, -2.72165547518141,
-2.73329474303528, -2.71147633070969, -2.71147633070969, -2.71292701762913,
-2.73329474303528, -2.73329474303528, -2.72165547518141, -2.71292701762913,
-2.73075363771866, -2.71197727883059, -2.7343739141538, -2.71507451885925,
-2.71061194970373, -2.7343739141538, -2.71061194970373, -2.71507451885925,
-2.7343739141538, -2.71507451885925, -2.71197727883059, -2.73075363771866,
-2.71507451885925, -2.71507451885925, -2.71061194970373, -2.7343739141538,
-2.71061194970373, -2.73075363771866, -2.7343739141538, -2.71197727883059,
-2.73075363771866, -2.71507451885925, -2.71061194970373, -2.7343739141538,
-2.71197727883059, -2.7343739141538, -2.71197727883059, -2.71061194970373
), group = c("D", "A", "D", "E", "E", "C", "B", "B", "A", "C",
"C", "E", "A", "C", "A", "D", "B", "E", "D", "E", "B", "D", "B",
"A", "C", "B", "B", "E", "D", "E", "C", "D", "A", "C", "B", "E",
"D", "A", "D", "A", "E"), category = c("High", "High", "High",
"High", "High", "High", "High", "High", "High", "High", "High",
"High", "High", "Low", "Low", "Low", "Low", "Low", "Low", "Low",
"Low", "Low", "Low", "Low", "Low", "Low", "Low", "Low", "Low",
"Low", "Low", "Low", "Low", "Low", "Low", "Low", "Low", "Low",
"Low", "Low", "Low")), row.names = c(NA, -41L), class = c("tbl_df",
"tbl", "data.frame"))