tracking_api_token | R Documentation |
This function adds a Tracking API token to your .Renviron file so it can be called securely without being stored in your code. After you have run this function, the token can be called by running Sys.getenv("TRACKING_API_TOKEN").
tracking_api_token(token, overwrite = TRUE, install = TRUE)
token |
Specifies the API token that was provided to you by the Tracking Program as a quoted string (e.g., "C6016D98-CGCA-495D-BF0B-EAAE20BADD98"). A token can be acquired by emailing, trackingsupport(AT)cdc.gov. Further information available at https://ephtracking.cdc.gov/apihelp. |
overwrite |
Allows you to overwrite an existing TRACKING_API_TOKEN stored in your .Renviron file. Defaults to TRUE. |
install |
Allows you to store the token in your .Renviron file for use in future sessions. Defaults to TRUE. |
This function and accompanying documentation were adapted from the tidycensus package with very little modification. Walker K, Herman M (2023). tidycensus: Load US Census Boundary and Attribute Data as 'tidyverse' and 'sf'-Ready Data Frames. R package version 1.3.2, https://walker-data.com/tidycensus/.
## Not run:
tracking_api_token("XXXXXXXXXXXXXXXXX")
#After you run this function, reload your environment so you can use the token without restarting R.
readRenviron("~/.Renviron")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.