Skip to contents

Creates a natural key for cruises in format YYMMKK where:

  • YY = 2-digit year

  • MM = 2-digit month

  • KK = 2-letter ship key

Usage

create_cruise_key(
  con,
  cruise_tbl = "cruise",
  ship_tbl = "ship",
  date_col = "date_ym"
)

Arguments

con

DuckDB connection

cruise_tbl

Name of cruise table (default: "cruise")

ship_tbl

Name of ship table (default: "ship")

date_col

Name of date column in cruise table (default: "date_ym")

Value

Invisibly returns the connection after adding cruise_key column

Examples

if (FALSE) { # \dontrun{
con <- get_duckdb_con()
create_cruise_key(con)
} # }