Description Usage Arguments Value Examples
Performs a series of string normalizations to get a clean shipname or callsign. This was inspired by Jaeyoon Park's Python Module: https://github.com/jaeyoonpark/shipdataprocess.
normalize_shipname
will do the following:
Make all letters into capital letters
Remove leading and trailing whitespaces
Remove linebreaks
Remove all references to vessel codes (i.e. MFV
stands for Marine Fishing Vessel)
Convert numbers expressed as letters to numbers (i.e. ONE
becomes 1
)
Convert roman numerals to arabic numbers
Remove NO.
when it references a number (i.e. BOAT NO.5
becomes BOAT5
)
Remove all special characters
normalize_callsign
will:
Make all letters into capital letters
Remove leading and trailing whitespaces
Remove linebreaks
Remove leading zeroes (i.e. 007JAMESBOND
becomes 7JAMESBOND
)
Remove all special characters
1 2 3 4 5 | normalize_shipname(name, ...)
normalize_callsign(callsign, ...)
normalize_economic_unit(economic_unit, ...)
|
name |
A character string (or vector of strings) to be normalized |
... |
Any other arguments |
callsign |
A character string (or vector of strings) to be normalized |
economic_unit |
A character string (or vector of strings) to be normalized |
A normmalized shipname or callsign
1 2 3 4 5 6 7 8 9 10 | # Normalize a shipname that contains special
# characters and roman numerals.
library(startR)
shipname <- "weird-+%()<>$;!&'`#/boat name IV"
normalize_shipname(shipname)
# Normalize a callsign starting with zeros
# and weird characters
callsign <- "0020300a-+%()<>$;!&'`#/"
normalize_callsign(callsign)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.