Description Usage Arguments Details Value Author(s) See Also Examples
frames_graph
creates a list of ggplot2
graphs displaying movement-environment interaction. Each object represents a single frame. Each frame can be viewed or modified individually. The returned list of frames can be animated using animate_frames
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
m |
|
r_list |
list of |
r_times |
list of |
r_type |
character, either |
fade_raster |
logical, if |
crop_raster |
logical, whether to crop rasters in |
return_data |
logical, if |
graph_type |
character, defines the type of multi-temporal graph that should be drawn as frames. Currently supported graphs are:
|
path_size |
numeric, size of each path. |
path_legend |
logical, wether to add a path legend from |
path_legend_title |
character, path legend title. Default is |
val_min |
numeric, minimum value of the value axis. If undefined, the minimum is collected automatically. |
val_max |
numeric, maximum value of the value axis. If undefined, the maximum is collected automatically. |
val_by |
numeric, increment of the value axis sequence. Default is 0.1. If |
verbose |
logical, if |
To later on side-by-side join spatial frames created using frames_spatial
with frames created with frames_graph
for animation,
equal inputs must have been used for both function calls for each of the arguments m
, r_list
, r_times
and fade_raster
.
List of ggplot2 objects, each representing a single frame. If return_data
is TRUE
, a data.frame
is returned (see return_data
).
Jakob Schwalb-Willmann
frames_spatial
join_frames
animate_frames
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | library(moveVis)
library(move)
library(ggplot2)
data("move_data", "basemap_data")
# align movement
m <- align_move(move_data, res = 4, unit = "mins")
r_list <- basemap_data[[1]]
r_times <- basemap_data[[2]]
# use the same inputs to create a non-spatial graph, e.g. a flow graph:
frames.gr <- frames_graph(m, r_list = r_list, r_times = r_times, r_type = "gradient",
fade_raster = TRUE, graph_type = "flow")
# take a look
frames.gr[[100]]
# make a histogram graph:
frames.gr <- frames_graph(m, r_list = r_list, r_times = r_times, r_type = "gradient",
fade_raster = TRUE, graph_type = "hist")
# change the value interval:
frames.gr <- frames_graph(m, r_list = r_list, r_times = r_times, r_type = "gradient",
fade_raster = TRUE, graph_type = "hist", val_by = 0.01)
frames.gr[[100]]
# manipulate the labels, since now they are very dense:
# just replace the current scale
frames.gr <- add_gg(frames.gr, expr(scale_x_continuous(breaks=seq(0,1,0.1),
labels=seq(0,1,0.1), expand = c(0,0))))
frames.gr[[100]]
# the same can be done for discrete data, histogram will then be shown as bin plots
# to make your own graphs, use frames_graph to return data instead of frames
frames.gr <- frames_graph(m, r_list = r_list, r_times = r_times, r_type = "gradient",
fade_raster = TRUE, return_data = TRUE)
# then simply animate the frames using animate_frames
# see all add_ functions on how to customize your frames created with frames_spatial
# or frames_graph
# see ?animate_frames on how to animate your list of frames
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.