Skip to contents

Load echo rffeature map from 'Birdscan MR1' 'SQL' database.

Usage

getEchoFeatures(
  dbConnection,
  dbDriverChar,
  listOfRfFeaturesToExtract,
  echoIDRange = NULL
)

Arguments

dbConnection

A valid database connection.

dbDriverChar

This was the name of the driver, and is now automatically detected, therefore it should be omitted into the future.

listOfRfFeaturesToExtract

a list of feature to extract

echoIDRange

NULL A two-element vector of integers to subset the rf feature extraction to a range of echoIDs. Default is to extract for all echoes.

Value

A list of the features extracted

Author

Fabian Hertner, Birgen Haest

Examples

if (FALSE) { # \dontrun{
# Set server and database settings
# ===========================================================================
dbServer = "MACHINE\\SERVERNAME" # Set the name of your SQL server
dbName = "db_Name" # Set the name of your database
dbDriverChar = "SQL Server" # Set either "SQL Server" or "PostgreSQL"

# Open the connection with the database
# ===========================================================================
dsn = paste0(
  "driver=", dbDriverChar, ";server=", dbServer,
  ";database=", dbName,
  ";uid=", rstudioapi::askForPassword("Database user"),
  ";pwd=", rstudioapi::askForPassword("Database password")
)
dbConnection = RODBC::odbcDriverConnect(dsn)

# Set list of Rf features you also want to extract
# Vector with RF features to extract. Feature IDs can be found in the
# 'rfFeatures' table in the sql database.
# Example: Get wing beat frequency and credibility: c(167, 168)
# Set to NULL to not extract any.
# ===========================================================================
listOfRfFeaturesToExtract = c(167, 168)

echoFeatures = getEchoFeatures(
  dbConnection,
  listOfRfFeaturesToExtract
)
} # }