extract_dataset: Extract a dataset available in Sardara database

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

View source: R/extract_dataset.R

Description

This function outputs a dataset available in the Tuna atlas database.

Usage

1
extract_dataset(con,metadata_dataset,labels=FALSE)

Arguments

con

a wrapper of rpostgresql connection (connection to a database)

metadata_dataset

data.frame of type "metadata" (one row extracted from the table metadata.metadata).

labels

boolean extract the dataset with codes and labels? TRUE = codes + labels . FALSE = only codes. Default is FALSE

Details

The meaning of the columns of a raw dataset is provided in the data dictionary of raw datasets. ## to fill in this description when it is finalized

Value

a data.frame of the data available in the database and set as dataset_name

Author(s)

Paul Taconet, paul.taconet@ird.fr

See Also

Other access data: getSQLSardaraQueries

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Connect to Tuna atlas database
con<-db_connection_tunaatlas_world()

# Extract a raw dataset
raw_dataset<-extract_dataset(con,list_metadata_datasets(con,dataset_name="global_catch_5deg_1m_1950_01_01_2016_01_01_tunaatlasIRD_level1"))

# Extract a code list
code_list<-extract_dataset(con,list_metadata_datasets(con,dataset_name="species_asfis"))

# Extract a mapping between code lists )
code_list_mapping<-extract_dataset(con,list_metadata_datasets(con,dataset_name="codelist_mapping_species_iotc_speciesgroup_tunaatlas"))

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