Skip to content

R Package implementing an API for Lotek collar data scraping

License

Notifications You must be signed in to change notification settings

rgzn/CollarScraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()

About

R Package implementing an API for Lotek collar data scraping

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages