queryDB {ProfoundData} | R Documentation |
A function to query the database
Description
A queryDB function to perform self-defined queries on the PROFOUND database.
Usage
queryDB(queryItem)
Arguments
queryItem |
a character string providing the query |
Note
To report errors in the package or the data, please use the issue tracker in the GitHub repository of ProfoundData https://github.com/COST-FP1304-PROFOUND/ProfoundData
Examples
# example requires that a sql DB is registered via setDB(dbfile)
# when run without a registered DB, you will get a file query (depending on OS)
## Not run:
# Basic query
overview <- queryDB("SELECT * FROM OVERVIEW")
tree <- queryDB("SELECT * FROM TREE")
# Site name or site_id
myQuery <- queryDB("SELECT date, tmax_degC FROM CLIMATE_LOCAL WHERE site == 'hyytiala'")
myQuery <- queryDB("SELECT date, tmax_degC FROM CLIMATE_LOCAL_12")
# Tree species
myQuery <- queryDB("SELECT * FROM TREE WHERE species == 'Picea abies'")
myQuery <- queryDB("SELECT * FROM TREE_piab")
# Specify variables
myQuery <- queryDB("SELECT date, tmax_degC FROM CLIMATE_LOCAL WHERE
tmax_degC > 20 AND site == 'hyytiala' AND year == 2010")
## End(Not run)
[Package ProfoundData version 0.2.1 Index]