normalize: Normalize shipname, callsign, and economic unit

Description Usage Arguments Value Examples

Description

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:

normalize_callsign will:

Usage

1
2
3
4
5

Arguments

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

Value

A normmalized shipname or callsign

Examples

 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)

jcvdav/startR documentation built on Oct. 13, 2021, 2:40 a.m.