list_dataset_available_dimensions: List dimensions available in a raw dataset

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/list_dataset_available_dimensions.R

Description

This function returns the dimensions available in a dataset. A dimension is set as available in a dataset if at least 1 value does exist for this dimension.

Usage

1
list_dataset_available_dimensions(con,dataset_metadata)

Arguments

con

a wrapper of rpostgresql connection (connection to a database)

dataset_metadata

data.frame of type "metadata" (one row extracted from the table metadata.metadata). Column table_type must be "raw_dataset"

Details

Example to understand the meaning of this function: Let us take the following dataset:

flag time_start time_end geographic_identifier gear species value
1992-02-01 1992-03-01 235140 LL YFT 0.05
1992-06-01 1992-07-01 230125 LL YFT 0.42
1992-07-01 1992-08-01 235140 LL YFT 1.05
1992-07-01 1992-08-01 240140 LL YFT 0.15
1992-08-01 1992-09-01 240140 LL YFT 0.61
1992-11-01 1992-12-01 230120 LL YFT 0.15
1992-11-01 1992-12-01 230125 LL YFT 0.15
1992-11-01 1992-12-01 235115 LL YFT 1.65
1992-11-01 1992-12-01 235135 LL YFT 5
1992-12-01 1993-01-01 235110 LL YFT 0.08
1992-12-01 1993-01-01 240140 LL YFT 0.12

In the above table, the dimension "flag" as not got any values. Hence, for this table the dimension "flag" is considered not to be available. The dimensions that will be returned by the function list_dataset_available_dimensions applied on this dataset are: time, area, gear, species

Value

a vector with the name of the dimensions available in the dataset.

Author(s)

Paul Taconet, paul.taconet@ird.fr

See Also

Other discover data: get_codelist_of_dimension, get_dsd_of_dataset, list_metadata_datasets, list_variable_available_dimensions

Examples

1
2
3
4
5
6
# Connect to Tuna atlas database
con<-db_connection_tunaatlas_world()

# List the available dimensions in the dataset "global_catch_5deg_1m_1950_01_01_2016_01_01_tunaatlasIRD_level1":
dataset_metadata(con,identifier="global_catch_5deg_1m_1950_01_01_2016_01_01_tunaatlasIRD_level1"))
list_dataset_available_dimensions(db_connection_tunaatlas_world(),dataset_metadata)

ptaconet/rtunaatlas documentation built on Sept. 21, 2021, 10:43 p.m.