Extract Nightly data from NABat Project and convert to 'detection history' format

Note: if you can't get nabatr to load on your computer, you can download this

data from the website by going to your projects, selecting a project, going

to the 'expore project data' button in the top right, selecting 'Frequency by

Time' tab at the top right and then clicking the 'Export NABat Data' button.

Skip to line 51

library(nabatr)
# Enter your NABat username here
username = 'nabat_username'
token = get_nabat_gql_token(username = username)
token

# Note: if you leave run token = get_nabat_gql_token(),
#   it will prompt you for a username and then a password

Pull Nightly Stationary acoustic data for 1 species

# Refresh login token
token = get_refresh_token(token)

# Use get_nightly_data with minimum parameters
# survey_type options = 'bulk_sae' | 'bulk_mae' | 'bulk_hib' | 'bulk_mat'
sae_nightly_data = get_nightly_data(token, 
  sp_code = 'MYLU',
  survey_type = 'bulk_sae')

# Display data
sae_nightly_data

Use more variables to get more specific data

# Refresh login token
token = get_refresh_token(token)

# Use get_nightly_data with all parameters
sae_nightly_data = get_nightly_data(token, 
  sp_code = c('MYLU', 'ANPA'), 
  sample_frame = c('CONUS','Alaska'),
  project_id = c(33,284),
  years = c(2015,2016,2017),
  survey_type = 'bulk_sae')

# Display data
sae_nightly_data

See species options

# Get your species lookup table
species_df = get_species(token = token)
# Display your species lookup table
species_df$species_code


usgs/nabatr documentation built on Jan. 28, 2024, 7:10 a.m.