fixReportSirenoFiles: Fix erroneous format of the reports from SIRENO in the...

View source: R/fixReportSirenoFiles.R

fixReportSirenoFilesR Documentation

Fix erroneous format of the reports from SIRENO in the 'observations' variable. Sometimes in SIRENO, in 'observations' variable, a semicolon or a enter is saved. When SIRENO generate the report files, the 'observations' variable is exported as it is, with the semicolon and enter characters. This means that some lines of the file have more than the theoretical number of variables (when observations variable have a semicolon inside) or less than the theoretical (when a enter character is in the observations variable of the previous row).

Description

This function check the number of variables and works as follow: - If the number of variables is the same of the theoretical, there aren't any changes. - When there are more variables than theoretical, the last variables are collapsed in the last one and changed the ";" to "." inside the observations variable - When there are less variable than the theoretical, we assume an enter has been saved in the observations variable of the previous row and after the enter there are more semicolons. The content of this row is added to the variable observation of the previous row and the ";" is changed to ".".

Usage

fixReportSirenoFiles(filename, filetype, path = getwd(), temporal = F)

Arguments

filename

File name of the file to check.

filetype

Type of file: RIM_CATCHES, RIM_CATCHES_IN_LENGTHS, RIM_LENGTHS, OAB_TRIPS, OAB_HAULS, OAB_CATCHES, OAB_LENGTHS, OAB_LITTER, OAB_ACCIDENTAL

path

Path of the file.

temporal

If is True, the file is exported in a temporal directory. This is useful when this function is used with sapmuebase import functions. When is false, the fixed report is exported in the path location

Note

Use this function carefully, if the format or the sireno reports changed can produce unexpected results. Furthermore, only is appropriate when the 'observations' field is the last one of the row.


Eucrow/sapmuebase documentation built on April 17, 2024, 10:29 a.m.