The purpose of the logbook_buoy_code_control function is to provide a table of data that contains a incoherent buoy code and buoy type naming convention

logbook_buoy_code_control(dataframe1, output)

Arguments

dataframe1

data.frame expected. Csv or output of the function data_extraction, which must be done before using the logbook_buoy_code_control.

output

character expected. Kind of expected output. You can choose between "message", "report" or "logical".

Value

The function returns a character with output is "message", a data.frame with output is "report", a logical with output is "logical".

Details

The input dataframe must contain all these columns for the function to work :

  • transmittingbuoy_id

  • transmittingbuoy_code

  • transmittingbuoytype_regex

Examples

#Buoy 1 is ok,
#Buoy 2 has start by 0
#Buoy 3 has a 7 digit identifier.
dataframe1 <- data.frame(transmittingbuoy_id = c("1", "2", "3", "4"),
                         transmittingbuoy_code = c("111111", "011111", "1234567", NA),
                         transmittingbuoytype_regex = c("[0-9]{6}", "[0-9]{6}", "[0-9]{6}",
                                                        "[0-9]{6}"))
logbook_buoy_code_control(dataframe1, output = "report")
#>   transmittingbuoy_id transmittingbuoy_code logical transmittingbuoytype_regex
#> 1                   1                111111    TRUE                   [0-9]{6}
#> 2                   2                011111   FALSE                   [0-9]{6}
#> 3                   3               1234567   FALSE                   [0-9]{6}
#> 4                   4                  <NA>   FALSE                   [0-9]{6}