Description Usage Arguments Details Value Examples
Project points in data
onto the globe and filter data
to points within the current field of view.
1 2 | do_projection(data, id, lon = 0, lat = 0, n.period = 360,
n.frames = n.period, keep = FALSE)
|
data |
a data frame. |
id |
character, column name referring to column of |
lon |
starting longitude for rotation sequence or vector of arbitrary longitude sequence. |
lat |
fixed latitude or vector of arbitrary latitude sequence. |
n.period |
intended length of the period. |
n.frames |
intended number of frames in animation. |
keep, |
if |
do_projection
projects the coordinates in data
onto the globe and filters data
to the subset of rows
containing data which are visible given the current field of view.
The field of view is defined by the centroid focus latitude and longitude pair in the sequence of latitudes and longitudes whose index
corresponds to the frame ID in data
. data
may containing rows with multiple unique frame ID values,
which the function will group the data by.
These values are used to determine position in the user-defined lon/lat sequence and the corresponding in-view subset of data
for each subset of data
grouped by the 'id' variable.
returns a data frame containing visible points on the globe or all points along with a boolean inview
column.
1 2 3 4 5 6 | library(dplyr)
library(purrr)
data(annualtemps)
temps <- mutate(annualtemps, frameID = Year - min(Year) + 1)
do_projection(temps, id="frameID")
do_projection(temps, id="frameID", keep=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.