Read an excel-file in the Smoltreg-format and do some basic cleanup before a data.frame is returned. If a vector of dummy_tags is given all tags matching are removed. The species name is standardized to capital first letter and the rest lowercase. Columns smoltstat and genid are uppercased. The column date_time is standarised to POSIXct and missing values are imputed using a "last observation carried forward" algorithm. Missing Any NA in column event are replaced with the UNKNOWN event code. Recaptured fish without species get the species set to the same as the MARKED event for that pit tag.
Usage
read_fish(
xlsxfile,
dummy_tags = NULL,
sheet = "Fiskdata",
date_formats = c("%Y-%m-%d %H:%M:%S", "%Y-%m-%d", "%m-%d-%Y %H:%M:%S",
"%m/%d/%y.%H:%M:%S")
)