check_index_changed: Check if a newly downloaded pacea object has changed from one...

View source: R/check-index-changed.R

check_index_changedR Documentation

Check if a newly downloaded pacea object has changed from one currently in pacea

Description

If index has changed from the saved one then save the new version. Only used for updating data (see files in 'data-raw').

Usage

check_index_changed(old, new, alpi = FALSE)

Arguments

old

original object (of class 'pacea_index', 'pacea_recruitment', 'pacea_biomass', or 'pacea_recruitment_herring') saved in pacea

new

newly downloaded and wrangled object (must also be one of the above classes)

alpi

logical if checking the 'alpi' object, as comparing axis name does not work because it is convoluted. See 'data-raw/coastwide-indices/alpi-update.R' for use.

Value

logical if the object has changed (and we would then want to resave it)

Author(s)

Andrew Edwards

Examples

## Not run: 
check_index_changed(oni, oni[-10, ]))
# see data-raw/groundfish/data.R
# see data-raw/coastwide-indices/coastwide-indices.R

## End(Not run)

pbs-assess/PACea documentation built on April 17, 2025, 11:36 p.m.