# Review new data

morts is a conservative framework to flag potential mortalities. This means that it can overestimate potential mortalities and some flagged mortalities may actually be alive. If new data are available - such as from receivers that were not previously available or an additional year in multiyear studies - movement of incorrectly flagged mortalities may be apparent.

In the example below, the data used to flag potential mortalities is to the left of the dashed line, and the new data are to the right of the dashed line. There is no station change evident for Fish G in the new data, so this fish is still considered a mortality. There is, however, a station change for Fish F, indicating this fish is still alive.

The `review()` function examines new data to determine if any animals move that were previously flagged as potential mortalities.

## Using `review()`

Two input dataframes are mandatory for `review()`:

1. `new.data` - a dataframe with residence events generated from the new dataset

2. `morts` - a dataframe of previously flagged mortalities

The new residence events in `new.data` must be generated using the same method as the original dataset, or must be manipulated to match the format of the original dataset. The format of `new.data` must also match the format of `morts`.

The other four required arguments, `type`, `ID`, `station`, and `res.start`, are specified in the same way as for `morts()` and `infrequent()`. See the Identifyig potential mortalities vignette for more information about these arguments.

    review_example<-review(morts=morts,new.data=new.data,type="mort",
                           ID="ID",station="Station.Name")

If there are no station changes between the flagged mortalities and `new.data`, or among the residence events within `new.data`, then nothing is returned. If a station change is found, the residence event with the station change will be returned.

Using the example in the first figure, Fish G is not included in the output of `review()`, because it did not move since it was flagged as a mortality. Fish F is included in the output, because a station change was detected.

ResidenceStart | Station.Name | ID | ResidenceEnd | ResidenceLength.days
--- | --- | --- | --- | ---
2006-11-16 19:31:00 | 27 | F | 2006-12-05 00:31:00 | 18.20833

The user can then review the station change to ensure it is valid before removing the animal from `morts` and including the animal in further analyses.

## Including previous data

An optional input is `old.data`, which is the original dataset or a subset of the original dataset that includes any residence events that may have occurred between the flagged potential mortality and the beginning of `new.data`. It is strongly recommended to include `old.data` if `backwards=TRUE` when the mortalities were previously identified and/or if drift was applied (see Drift vignette for more information on applying drift).

    review_example<-review(morts=morts,new.data=new.data,old.data=events,
                           type="mort",ID="ID",station="Station.Name")

## Applying drift

There is the option to apply drift when using `review()`. If applying drift, the arguments `ddd`, `from.station`, and `to.station` must be provided. See Drift vignette for more information on these arguments. In addition, the arguments `res.end`, `residences`, and `units` must be provided. These arguments are not necessary for identifying station changes with no drift, but are called by the function when drift is applied.

    drift_review<-review(morts=morts,new.data=new.data,old.data=old.data,
                         type="morts",ID="ID",station="Station.Name",
                         res.end="auto",residences="auto",units="auto",
                         ddd=ddd,from.station="From",to.station="To")