Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 1.36 KB

README.md

File metadata and controls

60 lines (42 loc) · 1.36 KB

CollarScraper

This is a package of GPS collar data downloaders. Currently this is just for Lotek.

Requirements:

Install

To install the development version from GitHub, run:

# install.packages("devtools")
devtools::install_github("rgzn/CollarScraper")

Use:

From within R:

require(CollarScraper)
username = ""
password = ""

# Create scraper:
myLotek = lotekScraper$new(username = username, password = password, headless = FALSE )

# Start browser:
myLotek$start()

# Submit login data:
myLotek$login()

# Get a data frame with available collars:
collarsDF = myLotek$get_collar_df()

# Set a start and end date for requested data:
end = Sys.Date()
begin = end - 365

# download a single collar:
collar1 = collarsDF[1,]
myFilename = myLotek$dl_collar(collar_id = collar1$ID,
                               start_date = begin,
                               end_date = end,
                               format = "Text Listing")

# download each collar and return a list of downloaded files
#    use default arguments for dl_collar method
downloadedFiles = lapply(collarsDF$ID, function(x) myLotek$dl_collar(x))

# stop browser:
myLotek$close()