Learn R Programming

birdscanR (version 0.3.0)

getRfClassification: Get a BirdScan 'rfClassification' table

Description

gets the 'rfClasses' table from a 'Birdscan MR1' 'SQL' database

Usage

getRfClassification(dbConnection, dbDriverChar)

Value

A list containing three variables: (1) rfclassificationTable: The 'rfClassification' database table; (2) classProbabilitiesAndMtrFactors: A dataframe containing the classification probabilities for all classes for each object; and (3) availableClasses: the classes used for the classification of the objects.

Arguments

dbConnection

a valid database connection

dbDriverChar

dbDriverChar 'SQL Server' The name of the driver. Should be either 'SQL Server' or 'PostgreSQL'. If 'PostgreSQL', it connects to cloud.birdradar.com

Examples

Run this code
if (FALSE) {
# 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)

rfClassification = getRfClassification(dbConnection, dbDriverChar)
}

Run the code above in your browser using DataLab