First, visit the Hipchat account API page. You will have to login with you avantcredit.com
hipchat account.
Scroll down and create your Hipchat token with the following permissions:
The token should appear in the list above. Copy the token, and then run the following line from your terminal (with the token replaced by your token):
echo "options(hipchat.api_token = '7PBfjOzd6tvewlHBAxsJxZImRU6ONHe2kjBYvpCQ')" >> ~/.Rprofile
The Rprofile file allows you to customize your R session at startup. By executing the above, you have ensured that the hipchat.api_token
R global option is set during startup.
Finally, install the hipchat package, and you should be able to send messages on Hipchat from within the R console! Run the R code below to install the hipchat package.
source("~/.Rprofile") # Ensure your hipchat token is loaded.
if (!is.element("devtools", utils::installed.packages()[, 1])) {
install.packages("devtools")
}
if (!is.element("hipchat", utils::installed.packages()[, 1])) {
devtools::install_github("robertzk/hipchat")
}
You can check that things work correctly by hipchatting the Analytics room:
hipchat::hipchat("Analytics", "Hello, world.")