tween_appear | R Documentation |
This function is intended for use when you have a data.frame of events at
different time points. This could be the appearance of an observation for
example. This function replicates your data nframes
times and
calculates the duration of each frame. At each frame each row is
assigned an age based on the progression of frames and the entry point of in
time for that row. A negative age means that the row has not appeared yet.
tween_appear(data, time, timerange, nframes)
data |
A data.frame to tween |
time |
The name of the column that holds the time dimension. This does not need to hold time data in the strictest sence - any numerical type will do |
timerange |
The range of time to create the tween for. If missing it will defaults to the range of the time column |
nframes |
The number of frames to create for the tween. If missing it
will create a frame for each full unit in |
A data.frame as data
but repeated nframes
times and
with the additional columns .age
and .frame
Other data.frame tween:
tween_along()
,
tween_components()
,
tween_elements()
,
tween_events()
,
tween_states()
data <- data.frame(
x = rnorm(100),
y = rnorm(100),
time = sample(50, 100, replace = TRUE)
)
data <- tween_appear(data, 'time', nframes = 200)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.