Use your .Rprofile to give you important notifications

June 23, 2016
By

(This article was first published on R – It's a Locke, and kindly contributed to R-bloggers)

In R, we can use a file called .Rprofile to do things in R based on a number of triggers. One thing I’ve done is give myself a DIY notification of how many data breaches I’ve been involved in!

First of all, you need a file called .Rprofile that’s stored in your working directory. Some useful resources about .Rprofiles can be found on .Rprofile CRAN docs and an .Rprofile intro.

Now inside that file, you can add a number of functions that are based on a number of events like loading or closing R. I need a .First function for on load and whatever I produce has to be able to print to the console with cat().

With that in mind, instead of showing details, I chose to show the number of breaches I’m in. You can get HIBPwned from CRAN and use it to query the awesome website HaveIBeenPwned.com.

One thing that’s neat about the account_breach() function is that I can query multiple email addresses or user formats to get info. Here is my .Rprofile file that gives me notifications on load for data breaches:

console .Rprofile result
console .Rprofile result

The post Use your .Rprofile to give you important notifications appeared first on It's a Locke.

To leave a comment for the author, please follow the link and comment on their blog: R – It's a Locke.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)