OB7-IRD / fishi

FISHeries Indicators: exploratory and descriptive processes of data associated to fisheries
https://ob7-ird.github.io/fishi
GNU General Public License v3.0
3 stars 0 forks source link

Add more genericity to the *data_extraction* function #5

Closed JulienLebranchu closed 1 year ago

JulienLebranchu commented 1 year ago

Update the function to be more generic

vessel_number_data <- data_extraction(
        type = "database",
        data_connection = balbaya_con,
        sql_name = "balbaya_vessel_number.sql",
        time_period = time_period,
        country = country,
        vessel_type = as.integer(x = c(1,2,4, 5, 6)),
        vessel_type_select = vessel_type_select,
        ocean = ocean
)

Proposition:

include default value to select all data.

vessel_number_data <- data_extraction(
        type = "database",
        data_connection = balbaya_con,
        sql_name = "balbaya_vessel_number.sql"
)

equivalent to

vessel_number_data <- data_extraction(
        type = "database",
        data_connection = balbaya_con,
        sql_name = "balbaya_vessel_number.sql",
        time_period = NULL,
        country = NULL,
        vessel_type = NULL,
        vessel_type_select = NULL,
        ocean = NULL
)