[Stable]

add_dates(data, date_col = "observation_start_time", parse_date = TRUE)

Arguments

data

a dataframe with datetime col observation_start_time, e.g. the output of ODKC form "turtle track or nest", "predator or disturbance", or "marine wildlife incident". If the date_col is plain text, it will be turned into a tz-aware datetime, else it is expected to be POSIXct / POSIXt.

date_col

(chr) The column name of the datetime to annotate. Default: "observation_start_time".

parse_date

(lgl) Whether the date_col needs to be parsed from character into a date format (TRUE, default) or already comes as a POSIXct/POSIXt.

Value

The initial dataframe plus new columns

  • calendar_date_awst (POSIXct) The calendar date in GMT+08 (AWST) as POSIXct, an ISO datetime in GMT+00.

  • calendar_date_awst_text (chr) The calendar date in GMT+08 (AWST) as character to prevent spreadsheet programs from corrupting the values.

  • calendar_year (int) The calendar year in GMT+08 (AWST) as integer.

  • turtle_date (POSIXct) The turtle date, see datetime_as_turtle_date.

  • season (int) The season, see datetime_as_season.

  • season_week (int) The season week, see datetime_as_seasonweek.

  • iso_week (int) The season week, see datetime_as_isoweek.