Learn R Programming

birdscanR (version 0.3.0)

getCollectionTable: Get BirdScan collection table

Description

load collection from 'Birdscan MR1' 'SQL' database

Usage

getCollectionTable(dbConnection, dbDriverChar)

Value

A dataframe with the collection table

Arguments

dbConnection

a valid database connection

dbDriverChar

the name of the driver. If different from '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)

collectionTable = getCollectionTable(dbConnection, dbDriverChar)
}

Run the code above in your browser using DataLab