It would take a lot more than 5 lines of code to do serious analysis of complex security data; in fact, there’s an entire book written on the topic of Data-driven Security. Here, though, we’re just looking at a list of announced security breaches in 2014 compiled by Privacy Rights Clearinghouse, focusing in on types of breaches and victims. Are there any interesting stories to tell from these two categories? The video below shows some easy ways of viewing item counts and generating a few visualizations from the data. If you’d like to try this yourself, the 5 lines of code are after the video. Breach data can be downloaded from the Privacy Rights Clearinghouse website. I did a bit of manual cleaning of that data and only kept columns I called DatePublic, Organization, Entity, Type, City, State, InfoSource and Year. (Unfortunately, data about numbers of people affected by each breach was not in a useful format for analysis). If you don’t already have GGally on your system, remember to download and install it first with install.packages("GGally"). breaches = read.csv("breaches_2014.csv", header = TRUE, stringsAsFactors = FALSE) table(breaches$Type) library(GGally) ggfluctuation2(table(breaches$Entity, breaches$Type)) barplot(table(breaches$Entity, breaches$Type), legend.text = TRUE, col = terrain.colors(7), main = "2014 breaches, via Privacy Clearinghouse") New to R? Check out my Beginner’s Guide to R free PDF download. See more examples of R in 5 lines or less. Related content feature Great R packages for data import, wrangling, and visualization Here are my go-to R packages — in a handy searchable table. By Sharon Machlis Sep 17, 2021 22 mins R Language Business Intelligence Analytics opinion R community blasts DataCamp response to exec's 'inappropriate behavior' RStudio, satRdays, and some instructors themselves are cutting ties with the online education company because they say DataCamp's response to the incident has been inadequate. By Sharon Machlis Apr 17, 2019 11 mins Technology Industry Careers news Google will shut down Fusion Tables After more than a decade in service, Google's easy-to-use cloud visualization service is being shuttered. By Sharon Machlis Dec 11, 2018 3 mins Google Cloud Computing Productivity Software reviews Useful R functions you might not know By Sharon Machlis Nov 21, 2018 11 mins R Language Business Intelligence Open Source Podcasts Videos Resources Events SUBSCRIBE TO OUR NEWSLETTER From our editors straight to your inbox Get started by entering your email address below. Please enter a valid email address Subscribe