satBackup: Backup for Ruido's functions

View source: R/satBackup.R

satBackupR Documentation

Backup for Ruido's functions

Description

This function offers a way to continue an unfinished process of the soundSat(), soundMat() or multActivity() functions through a backup file. Arguments can't be inputted nor changed since the function will automatically load them from the .RData file. However you may manually change them by editing the file (not recommended).

Usage

satBackup(backup)

Arguments

backup

path to the .RData file create by the backup of soundSat, soundMat or multActivity

Value

This functions returns the same output of soundSat(), soundMat() or multActivity()

Examples

## Not run: 
# It's impossible to demonstrate this function's intended use due to it's nature
# However, here is how this function is used:
## This example will load an entire day of audios to your computer, so beware.

### Downloading audiofiles from public Zenodo library
dir <- paste(tempdir(), "forExample", sep = "/")
dir.create(dir)
recName <- paste0("GAL24576_20250401_", sprintf("%06d", seq(0, 230000, by = 10000)),".wav")
recDir <- paste(dir, recName, sep = "/")

for(rec in recName) {
  print(rec)
  url <- paste0("https://zenodo.org/records/17575795/files/", rec, "?download=1")
  download.file(url, destfile = paste(dir, rec, sep = "/"), mode = "wb")
}

sat <- soundSat(dir, backup = dir)

# Now pretend the process was interrupted (manually/your R crashed/your computer turned off)
# We get the backup file

list.files(dir)
backupDir <- paste(dir, "SATBACKUP.RData", sep = "/")

# To recall the backup you simply:

satB <- satBackup(backupDir)

head(satB$values)

unlink(dir, recursive = TRUE)

## End(Not run)

Ruido documentation built on April 18, 2026, 5:07 p.m.