getSQLSardaraQueries: Get a list of queries to execute to plug services to the...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/getSQLSardaraQueries.R

Description

Get a list of queries to execute to manage the datasets available in Sardara (extract in csv format, in netcdf, etc.)

Usage

1
getSQLSardaraQueries(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).

Value

a list with SQL queries and informations on the dataset. Depending on the type of data (raw_dataset, codelist, mapping), the output elements of the list might vary. The elements of the list are:

Author(s)

Paul Taconet, paul.taconet@ird.fr

See Also

Other access data: extract_dataset

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Connect to Tuna atlas database
con<-db_connection_tunaatlas_world()
 
 # retrieve metadata row of dataset global_catch_5deg_1m_1950_01_01_2016_01_01_tunaatlasIRD_level1
dataset_metadata<-list_metadata_datasets(con,identifier="global_catch_5deg_1m_1950_01_01_2016_01_01_tunaatlasIRD_level1")
queries<-getSQLSardaraQueries(con,dataset_metadata)

# retrieve data.frame of global_catch_5deg_1m_1950_01_01_2016_01_01_tunaatlasIRD_level1

global_catch_5deg_1m_1950_01_01_2016_01_01_tunaatlasIRD_level1<-dbGetQuery(con,queries$query_CSV)

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