---
title: "How to save and load a PresenceAbsence object"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{save-load-presenceabsence}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
   eval = FALSE
)
```

`PresenceAbsence` objects include SpatRaster objects that cannot be saved directly into an RData external file. For this reason, we developed specific functions (`lets.save` and `lets.load`) to save and load `PresenceAbsence` objects in a similar fashion to the base functions `save` and `load`. 

```{r setup, message = FALSE}
library(letsR)
```
```{r}
data(PAM) # Example data
lets.save(PAM, file = "PAM.RData") # save the PresenceAbsence object
PAM <- lets.load(file = "PAM.RData") # Load the PresenceAbsence object 
```

