Site icon R-bloggers

Happy Holidays Data Lovers!

[This article was first published on Little Miss Data, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Warmest seasons greetings to all of my fellow data nerds!

Like myself, I know that a lot of you love pretty visualizations.  So, this Christmas I am giving the small gift of a new R package to explore.  I will be providing a more in-depth example in the next few weeks.  In the meantime, below is a teaser. 

Run this code in any R environment, including R Studio and IBM Cloud Data Science Experience.

## A fun plot to say seasons greetings
install.packages("alluvial")
library(alluvial)

data2 <- read.table(header=TRUE, text='
 subject Joyeaux Noel freq
                   1   Happy   Holidays   1
                   2   Seasons   Greetings   1
                   ')

dataframe <- as.data.frame(data2)

alluvial(dataframe[,2:3], freq=dataframe$freq,
         col = ifelse(dataframe$Joyeaux == "Happy", "red", "green"),
         border = ifelse(dataframe$Joyeaux == "Happy", "red", "green"),
         cex = 0.7
)

To leave a comment for the author, please follow the link and comment on their blog: Little Miss Data.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.