#library(nabatr) devtools::load_all(".") # Enter your NABat username here username_ = 'Nabat_Username' token_ = get_nabat_gql_token(username = username_) token_ # If you are not using R-Studio or are not prompted for a password use this code below # to manually add in your password with the password variable: # token_ = get_nabat_gql_token(username = username_, password = 'your-password')
# Get your projects lookup table project_df_ = get_projects(token = token_) # Display your projects lookup table project_df_
# Get your species lookup table species_df_ = get_species(token = token_) # Display your species lookup table species_df_
# Fill in project id using the project_df_ lookup table project_id_ = 275 # Set equal to one of your project ids # Get survey dataframe survey_df_ = get_project_surveys(token = token_, project_df = project_df_, project_id = project_id_) # Display survey dataframe survey_df_
colony_bulk_df_ = get_colony_bulk_counts(token = token_, survey_df = survey_df_, project_id = project_id_) colony_bulk_df_
# Edit This file path to your own output directory to store the report (No trailing '/') out_dir_doc = here::here() # Build report and return the doc to then save out doc_ = build_col_doc(out_dir = out_dir_doc, file_name = paste0('doc_report_','_',Sys.Date(),'.docx'), project_df = project_df_, project_id = project_id_, cover_photo = "/inst/templates/nabat_logo.png", colony_bulk_df = colony_bulk_df_, date = format(Sys.time(), "%B %d, %Y")) # Save it out to a local directory print(doc_, target = paste0(out_dir_doc, '/', paste0('colony_count_report_',project_id_,'_',format(Sys.time(), '%Y_%m_%d_%H%M%S'),'.docx')))
# Edit This file path to your own output directory to store the report (No trailing '/') out_dir_html = '/path/to/output/directory' # Build Report and save out the report get_acoustic_stationary_report(token = token_, output_dir = out_dir_html, file_name = paste0('report_',project_id_,'_',Sys.Date(),'','.html'), nightly_plots_type = 'sites', # 'grts' | 'sites' output_type = 'html', project_id = project_id_, survey_df = survey_df_, acoustic_bulk_df = acoustic_bulk_df_, nightly_observed_list = nightly_observed_list_, num_plots = 20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.