store_ebird: Send filtered eBird data frame to SQLite database.

Description Usage Arguments Details Examples

Description

This function appends a data.frame created by parse_ebird to an existing SQLite database.

Usage

1
2
store_ebird(df, file = NULL, db = "../Data/SE_eBird.sqlite",
  table_name = "SE_eBird_Aug2015")

Arguments

df

a data.frame created by parse_ebird

file

character string of the file path to the tab-delimited eBird .txt file; if specified, df is ignored. Useful for combining the parsing and storing of eBird records in a single step

db

character string containing the file path to the appropriate SQLite database

table_name

character string specifying a DBMS table name

Details

This requires an existing SQLite database that is ready to receive the output of parse_ebird. See example below for how the local database was set up for southeast refuges.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Not run: 
# Set up eBird SQLite database
library(sqldf)
db <- dbConnect(SQLite(), dbname="./Data/SE_eBird.sqlite")

dbSendQuery(conn = db,
            "CREATE TABLE SE_eBird_Aug2015
            (id TEXT,
            tax_order REAL,
            category TEXT,
            common_name TEXT,
            sci_name TEXT,
            count INTEGER,
            county TEXT,
            lat REAL,
            lon REAL,
            date INTEGER,
            checklist TEXT,
            all_spp INTEGER)")

ga_birds <- parse_ebird("./Data/ebd_US-GA_relAug-2015.txt")
store_ebird(ga_birds)

# Close connection
dbDisconnect(db)

## End(Not run)

adamdsmith/geobird documentation built on May 10, 2019, 5:13 a.m.