<commit_before># Availability

Estimating geographic space available to animals based on telemetry data.

## Installation:
```
library(devtools)
install_github("AustralianAntarcticDataCentre/availability")
```

## Example usage:
Using the vector-AR method (see [1]):
```{r}
library(availability)
## load observed track, 2-column matrix of longitude and latitude
## the track points should be equally sampled in time
realtrack=...
arf=surrogateARModel(realtrack) ## fit AR model to track
st=surrogateAR(arf,realtrack) ## simulate new track
```

Or using the crawl-based track simulator:
```{r}
library(availability)
library(crawl)
fit=crwMLE(...) ## fit crawl to your raw data
pr=fit$pred ## extract predicted (fitted) track
pr=pr[pr$locType=="p",] ## keep only regularly-interpolated locations
## construct the corresponding transition and covariance matrices of the state space model for time increment `dt`
model=surrogateCrawlModel(fit,dt)
## and finally simulate the track
stcrw=surrogateCrawl(model,as.matrix(pr[,c("mu.x","mu.y","nu.x","nu.y")]),pr$date)
```

More detailed usage examples will follow soon.

## References
[1] <NAME> *et al.* (2014) Important marine habitat off East Antarctica revealed by two decades of multi-species predator tracking. *Ecography* **38**:121–129. [doi:10.1111/ecog.01021](http://dx.doi.org/10.1111/ecog.01021)<commit_msg>link to vignette pdf<commit_after># Availability

Estimating geographic space available to animals based on telemetry data.

## Installation:
```
library(devtools)
install_github("AustralianAntarcticDataCentre/availability")
```

## Example usage:
Using the vector-AR method (see [1]):
```{r}
library(availability)
## load observed track, 2-column matrix of longitude and latitude
## the track points should be equally sampled in time
realtrack=...
arf=surrogateARModel(realtrack) ## fit AR model to track
st=surrogateAR(arf,realtrack) ## simulate new track
```

Or using the crawl-based track simulator:
```{r}
library(availability)
library(crawl)
fit=crwMLE(...) ## fit crawl to your raw data
pr=fit$pred ## extract predicted (fitted) track
pr=pr[pr$locType=="p",] ## keep only regularly-interpolated locations
## construct the corresponding transition and covariance matrices of the state space model for time increment `dt`
model=surrogateCrawlModel(fit,dt)
## and finally simulate the track
stcrw=surrogateCrawl(model,as.matrix(pr[,c("mu.x","mu.y","nu.x","nu.y")]),pr$date)
```

More detailed usage examples are in the package vignette, which is also [available as a PDF](./vignettes/availability.pdf?raw=true).

## References
[1] <NAME> *et al.* (2014) Important marine habitat off East Antarctica revealed by two decades of multi-species predator tracking. *Ecography* **38**:121–129. [doi:10.1111/ecog.01021](http://dx.doi.org/10.1111/ecog.01021)
{'fraction_non_alphanumeric': 0.13179396092362344, 'fraction_numerical': 0.026287744227353464, 'mean_word_length': 6.202046035805626, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1385029', 'n_tokens_mistral': 963, 'n_tokens_neox': 832, 'n_words': 277}