harmonize_time_structure: Set of functions to harmonize the time dimension structure of...

harmonize_time_structureR Documentation

Set of functions to harmonize the time dimension structure of the source tRFMOs datasets

Description

Set of functions to harmonize the structure of the datasets for the time dimension

Usage

harmo_time_1(df_input,colname_year,colname_timeperiod)
harmo_time_2(df_input,colname_year,colname_month)
harmo_time_3(df_input,colname_year,colname_monthstart,colname_monthstop)

Arguments

df_input

data.frame with the time structure to harmonize

colname_year

string. Name of the column of years.

colname_timeperiod

string. Name of the column of period of time.

colname_month

string. Name of the column of month.

colname_monthstart

string. Name of the column of starting month of validity of the data.

colname_monthstop

string. Name of the column of ending month of validity of the data

Details

  • colname_year: Integer: YYYY

  • colname_timeperiod: Integer. Periods are defined as following:

    • 1 to 12: 1 month time period. The number gives the month number in the year (e.g. 1=January, 2=February, etc.);

    • 13 to 16: 1 quarter time period. 13=January to March, 14=April to June, 15=July to September, 16=October to December;

    • 17: One year time period;

    • 18 and 19: 1 semester time period. 18=January to June, 19=July to December

  • colname_month: Integer: MM

  • colname_monthstart: Integer: MM

  • colname_monthstop: Integer: MM

In 2017, the time structure of the source tRFMOs datasets are converted with the following functions:

  • harmo_time_1:

  • harmo_time_2:

  • harmo_time_3:

The functions harmo_time_1, harmo_time_2, harmo_time_3, harmo_time_4 work as following:

1) Fist they convert the source time structure to the following target structure:

  • One column "Year" giving the year,

  • One coumn "MonthStart" giving the first month of the period,

  • One column "Period" giving the period. The period is defined as hereunder:

    • 1 = one month

    • 3 = one trimester

    • 6 = one semester

    • 12 = one year

2) Then they convert the latter structure to the structure with the time_start and time_end columns (this step is done using the function format_time_db_format)

Value

a data.frame in which time dimension is structured with two columns:

  • time_start: providing the starting date of validity of the data (included)

  • time_end: providing ending date of validity of the data (excluded)

Author(s)

Paul Taconet, paul.taconet@ird.fr

See Also

Other harmonize data structure: iattc_functions, iccat_functions, iotc_functions, wcpfc_functions


ptaconet/rtunaatlas documentation built on June 23, 2024, 9:35 p.m.