---
title: "Interface to other packages with `amt`"
author: "Johannes Signer"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Interface to other packages with `amt`}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, include=FALSE}
knitr::opts_chunk$set(warning = FALSE, message = FALSE)
```


## About

This vignette briefly introduces how one can coerce `amt track_xy*` to other commonly used packages. At the moment this vignette shows methods to coerce to `adehabitatHR`, `ctmm`, and `move`.

## Getting the data ready

First we load the required libraries and the relocation data (called `deer`)

```{r}
library(amt)
data("deer")
class(deer)
deer
```

## `adehbatit*`

```{r}
adehabitatLT_ltraj <- as_ltraj(deer)
class(adehabitatLT_ltraj)
adehabitatLT_ltraj
```


## `ctmm`

With the function `as_telemetry` a `track_xyt` can be coerced to a `telemetry` object used in `ctmm`.

```{r}
ctmm_obj <- as_telemetry(deer)
class(ctmm_obj)
head(ctmm_obj)
```

## `sf`

There are three functions that convert tracks/steps to tibbles with a geometry columns (`sf`-objects). 

1. `as_sf()` converts a track or steps to a point geometry, by calling that the function `as_sf_points()`. For steps the end points of steps is used by default. Setting `end = FALSE` will use the start points. 
2. `as_sf_point()`

It is possible to convert a track and steps to tibble with a geometry column using the function `as_sf

# Todo
## `move`

```{r}

```



## Session

```{r}
sessioninfo::session_info()
```


