Publications by Riddhiman
Radar charts in R using Plotly
This post is inspired by this question on Stack Overflow.. We’ll show how to create excel style Radar Charts in R using the plotly package. library(plotly) library(dplyr) # Read in data df <- read.csv("https://cdn.rawgit.com/plotly/datasets/master/Consumer%20Complaints.csv", stringsAsFactors = F, check.names = F) # Melt df <-...
540 sym R (6584 sym/1 pcs)
Macroeconomic charts by the Fed using R and Plotly
In this post we’ll try to replicate some of the charts created by the Federal Reserve which visualize some well known macroeconomic indicators. We’ll also showcase the new Plotly 4.0 syntax. Key Macroeconomic Indicators library(plotly) library(zoo) df <- read.csv("https://cdn.rawgit.com/plotly/datasets/master/Key%20Macroecon...
733 sym R (10047 sym/3 pcs)
Time series charts by the Economist in R using Plotly
In this post we’ll recreate two info graphics created by The Economist. The code uses the new Plotly 4.0 syntax. Note: Plotly 4.0 has not been officially released yet. You can download the dev version using devtools::install_github("ropensci/[email protected]/nse") Volume of google searches related to immigrating to Canada library(plotly) lib...
694 sym R (14309 sym/3 pcs)
Candlestick charts using Quandl and Plotly
In this post we’ll show how to create candle stick charts using the new plotly 4.0 syntax. You can refer to this older post as well. This time we’ll use the Quandl package to retrieve stock data. See here for more details. install.packages("Quandl") library(Quandl) df <- Quandl("WIKI/AAPL") df <- df[,c(1, 9:12)] names(df) <- c("Date", "...
656 sym R (1485 sym/1 pcs)
Plotcon 2016 – Speakers and topics in R
Jenny Bryan Topic: Extract plotting intent from spreadsheets in R Bio: Jennifer Bryan is an Associate Professor in the Statistics Department and the Michael Smith Laboratories at the University of British Columbia in Vancouver. She’s a biostatistician specialized in genomics and takes a special interest and delight in data analysis and statist...
5347 sym 20 img
New feature: Dropdown menus in Plotly and R
In this post we’ll showcase the new dropdown menu button feature. It adds a layer of interactivity that is similar to shiny but supported within the plotly package. Adding new menu buttons is as simple as specifying the updatemenus parameter inside layout. Each dropdown menu needs to be a separate list with position parameters x and y a well a...
900 sym R (1410 sym/2 pcs)
Using cranlogs in R with Plotly
In this post we’ll use the cranlogs package to visualize the number of downloads for Plotly’s R API library(cranlogs) library(plotly) library(zoo) # Get data df <- cran_downloads(packages = c("plotly", "ggplot2"), from = "2015-10-01", to = "2016-08-01") # Convert dates df$date <- as.Date(df$date) # Make data f...
499 sym R (1945 sym/1 pcs)
Radial Stacked Area Chart in R using Plotly
In this post we’ll quickly show how to create radial stacked ara charts in plotly. We’ll use the AirPassengers dataset. Inspired by Mike Bostocks post: http://bl.ocks.org/mbostock/3048740 #devtools::install_github("ropensci/plotly") library(plotly) library(zoo) library(data.table) # Load Airpassengers data set data("AirPassengers") ...
612 sym R (2917 sym/1 pcs)
Visualizing ROC Curves in R using Plotly
In this post we’ll create some simple functions to generate and chart a Receiver Operator (ROC) curve and visualize it using Plotly. See Carson’s plotly book for more details around changes in syntax. We’ll do this from a credit risk perspective i.e. validating a bank’s internal rating model (we’ll create a sample dataset keeping this ...
965 sym R (4396 sym/4 pcs)
Using the pipe operator in R with Plotly
With the release of Plotly 4.0 using the pipe %>% operator is a lot more intuitive when using plot_ly(). Quick Introduction For those new to the pipe operator from the magrittr package here’s a quick introduction. In essence, the pipe operator takes the argument on the left hand side of the operator and inserts it (after evaluation if an expre...
1513 sym R (1495 sym/11 pcs) 2 img