library(nabatr) # Enter your NABat username here username = 'NABat_Username' token = get_nabat_gql_token(username) token # Note: if you leave run token = get_nabat_gql_token(), # it will prompt you for a username and then a password
# Data request id - Can be found at the top of your data request id = 00
# Refresh token token = get_refresh_token(token) # See all of the data request approvals approvals_df = get_data_request_approvals(token = token, data_request_id = id) # Display approvals dataframe approvals_df
# Refresh token token = get_refresh_token(token) # Build data request response = build_data_request(token = token, data_request_id = id) response
# Refresh token token = get_refresh_token(token) # Get data request list of files available for download files_df = get_data_request_files(token = token, data_request_id = id) # Display files dataframe files_df
# Get key (grabs latest key) key = files_df[length(files_df$key),]$key # Display key to use for downloading zip file key
# Refresh token token = get_refresh_token(token) # Set your output file here ex: '/path/to/your/outputfile.zip' output_file = '/path/to/your/outputfile.zip' # Downloads the Zip file into the output_file download_data_request(token = token, key = key, output_file = output_file)
# Set a folder to unzip the zip file into ex: '/path/to/unzip/contents/into' unzip_folder = '/path/to/unzip/contents/into' unzip(output_file, exdir = unzip_folder)
# Read in the csv from the data request that is unzipped in the unzip folder data_request_df = readr::read_csv(paste0(unzip_folder, '/data.csv')) # Display Data data_request_df
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.