| Type: | Package | 
| Title: | Studying Sampled Trajectories | 
| Version: | 1.0.0 | 
| Author: | Pablo Rodriguez-Sanchez (https://pabrod.github.io) and Sanne J. P. van den Berg (https://www.wur.nl/en/Persons/Sanne-dr.-SJP-Sanne-van-den-Berg.htm) | 
| Maintainer: | Pablo Rodriguez-Sanchez <pablo.rodriguez.sanchez@gmail.com> | 
| Description: | Allows analyzing time series representing two-dimensional movements. It accepts a data frame with a time (t), horizontal (x) and vertical (y) coordinate as columns, and returns several dynamical properties such as speed, acceleration or curvature. | 
| License: | MIT + file LICENSE | 
| Encoding: | UTF-8 | 
| LazyData: | true | 
| RoxygenNote: | 7.1.1 | 
| VignetteBuilder: | knitr | 
| Suggests: | testthat, knitr, utils, markdown, rmarkdown, ggplot2 | 
| Imports: | numDeriv, stats | 
| Depends: | R (≥ 3.5.0) | 
| NeedsCompilation: | no | 
| Packaged: | 2021-07-15 21:09:01 UTC; pablo | 
| Repository: | CRAN | 
| Date/Publication: | 2021-07-19 07:30:02 UTC | 
Return accelerations
Description
Return accelerations
Usage
accel(t, x, y)
Arguments
| t | The times vector | 
| x | The x positions | 
| y | The y positions | 
Value
The accelerations
See Also
Return a dataframe with information about the time-to-time displacements
Description
The displacement is a bit more complicated than other dynamical variables, as it depends on the sampling frequency. If you are subsampling, always re-run append_displacement after subsampling.
Usage
append_displacement(data)
Arguments
| data | A dataframe containing t, x and y | 
Value
A data frame including all the dynamical information, including displacements
See Also
Return a data frame with extra columns with dynamical information
Description
Return a data frame with extra columns with dynamical information
Usage
append_dynamics(data, append.displacement = TRUE)
Arguments
| data | A dataframe containing t, x and y | 
| append.displacement | (Optional) Set it to FALSE to not calculate displacements. Useful if the data is going to be resampled | 
Value
A data frame including instantaneous dynamical variables, such as speed and acceleration
See Also
speed, accel, append_displacement
Approximate derivative
Description
Approximate derivative
Usage
approx_derivative(t, x)
Arguments
| t | Vector of times | 
| x | Vector of values | 
Value
A vector (of the same size of t) representing the numerical derivative
See Also
Return curvatures
Description
Return curvatures
Usage
curvature(t, x, y)
Arguments
| t | The times vector | 
| x | The x positions | 
| y | The y positions | 
Value
The local curvature
See Also
speed, accel, curvature_radius
Return curvature radius
Description
Return curvature radius
Usage
curvature_radius(t, x, y)
Arguments
| t | The times vector | 
| x | The x positions | 
| y | The y positions | 
Value
The local curvature radius
See Also
Return displacements
Description
Return displacements
Usage
displacement(x, y)
Arguments
| x | The x positions | 
| y | The y positions | 
Value
The displacements between a position and its previous
Example data set
Description
Experimental sample of 3000 positions of a macroinvertebrate
Format
A data frame with 3000 observations of:
- x
- horizontal position 
- y
- vertical position 
- t
- time 
...
Get polar coordinates
Description
Get polar coordinates
Usage
get_polar_coordinates(x, y, origin = c(0, 0))
Arguments
| x | Vector of x coordinates | 
| y | Vector if y coordinates | 
| origin | (Default = c(0, 0)) Position of the origin of coordinates | 
Value
Data frame with radius (r) and angle vectors (th)
Return speeds
Description
Return speeds
Usage
speed(t, x, y)
Arguments
| t | The times vector | 
| x | The x positions | 
| y | The y positions | 
Value
The speeds