Skip to contents

Creating and converting aniframe objects

Functions that create an aniframe, coerce other objects to aniframe, or provide example data.

as_aniframe()
Convert a data frame to aniframe
aniframe()
aniframe package
example_aniframe()
Create example aniframe data
is_aniframe()
Check if object is an aniframe
ensure_is_aniframe()
Ensure object is an aniframe

Metadata handling

Functions for reading, setting, and retrieving the metadata attached to an aniframe.

get_metadata()
Get metadata
set_metadata()
Set metadata for an aniframe
set_unit_time()
Set the temporal unit of an aniframe object
set_unit_space()
Set the spatial unit of an aniframe object
set_unit_angle()
Set the angular unit of an aniframe object
set_sampling_rate()
Set the sampling rate of an aniframe object
get_trackball_calibration_factor()
Calculate trackball calibration factor
default_metadata()
Default metadata structure

Transformations

These functions allow you to make tranformations to your coordinate system, such as translations, rotations or conversion to polar coordinates.

transform_to_egocentric()
Transform coordinates to egocentric reference frame
translate_coords()
Translate coordinates (Cartesian)
rotate_coords()
Rotate coordinates in Cartesian space (2D or 3D)
map_to_cartesian()
Map from polar to Cartesian coordinates
map_to_polar()
Map from Cartesian to polar coordinates
map_to_cylindrical()
Map from Cartesian to cylindrical coordinates
map_to_spherical()
Map from Cartesian to spherical coordinates
cartesian_to_rho()
Cartesian radius (ρ) from coordinates
cartesian_to_phi()
Cartesian azimuth (φ) from coordinates
cartesian_to_theta()
Polar angle (θ) from Cartesian coordinates
polar_to_x()
Convert polar radius to Cartesian x‑coordinate
polar_to_y()
Convert polar radius to Cartesian y‑coordinate
spherical_to_z()
Convert cylindrical radius and polar angle to Cartesian z‑coordinate

Helpers

rad_to_deg()
Convert radians to degrees
deg_to_rad()
Convert degrees to radians
calculate_angular_difference()
Calculate angular difference
constrain_angles_radians()
Constrain angles to [0, 2π)
diff_angle()
Difference of angular values

Data manipulation (dplyr‑style verbs)

S3 methods that mirror dplyr verbs for aniframe objects.

arrange(<aniframe>)
Arrange rows of an aniframe
filter(<aniframe>)
Filter rows of an aniframe
group_by(<aniframe>)
Group an aniframe
mutate(<aniframe>)
Mutate columns in an aniframe
relocate(<aniframe>)
Relocate columns in an aniframe
rename(<aniframe>)
Rename columns in an aniframe
select(<aniframe>)
Select columns from an aniframe
slice(<aniframe>)
Slice rows from an aniframe
tbl_sum(<aniframe>)
Custom tibble summary for aniframe
ungroup(<aniframe>)
Ungroup an aniframe

Conversion helpers

Methods that let you treat aniframe objects like regular data frames.

as.data.frame(<aniframe>)
Convert aniframe to regular data frame
`[`(<aniframe>)
Subset aniframe with [
`[[`(<aniframe>)
Extract single column from aniframe with [[
`[[<-`(<aniframe>)
Column assignment for aniframe with [[<-
`[<-`(<aniframe>)
Subset assignment for aniframe with [<-
`$<-`(<aniframe>)
Column assignment for aniframe with $<-
`$`(<aniframe>)
Extract column from aniframe with $
`names<-`(<aniframe>)
Rename columns with names<-