extract_dataset: Extract a dataset available in Sardara database

View source: R/extract_dataset.R

extract_datasetR Documentation

Extract a dataset available in Sardara database

Description

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

Usage

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


# 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 June 23, 2024, 9:35 p.m.