Publications by Teja Kodali

Visualising thefts using heatmaps in ggplot2

17.08.2015

This is a continuation of my previous article, where I gave a basic overview of how to construct heatmaps in R. Here, I will show you how to use R packages to build a heatmap on top of the map of Chicago to see which areas have the most amount of crime. We will require two packages for the mapping, namely maps, and ggmap. We will also use two mor...

4368 sym R (1088 sym/7 pcs) 12 img

Data Manipulation with dplyr

20.08.2015

dplyr is a package for data manipulation, written and maintained by Hadley Wickham. It provides some great, easy-to-use functions that are very handy when performing exploratory data analysis and manipulation. Here, I will provide a basic overview of some of the most useful functions contained in the package. For this article, I will be using the...

3592 sym R (2126 sym/12 pcs) 8 img

Building Wordclouds in R

28.08.2015

In this article, I will show you how to use text data to build word clouds in R. We will use a dataset containing around 200k Jeopardy questions. The dataset can be downloaded here (thanks to reddit user trexmatt for providing the dataset). We will require three packages for this: tm, SnowballC, and wordcloud. First, let’s load the required lib...

2901 sym R (532 sym/7 pcs) 10 img

Building interactive web apps with Shiny

11.09.2015

In this post, I will show you how to build this app. I will be using the dataset for yellow taxis in the month of January 2015 provided by the NYC Taxi & Limousine Commission. You will need RStudio for this. Since the dataset is very big, I created a smaller dataset that doesn’t contain as many rows. The smaller dataset can be found here. The c...

4271 sym R (2155 sym/8 pcs) 10 img

Using the apply family of functions in R

12.09.2015

In this article, I will demonstrate how to use the apply family of functions in R. They are extremely helpful, as you will see. apply apply can be used to apply a function to a matrix. For example, let’s create a sample dataset: data <- matrix(c(1:10, 21:30), nrow = 5, ncol = 4) data [,1] [,2] [,3] [,4] [1,] 1 6 21 26 [2,] 2 ...

1741 sym R (613 sym/7 pcs) 8 img

Using the ggplot2 library in R

20.09.2015

In this article, I will show you how to use the ggplot2 plotting library in R. It was written by Hadley Wickham. If you don’t have already have it, install it and load it up: install.packages('ggplot2') library(ggplot2) qplot qplot is the quickest way to get off the ground running. For this demonstration, we will use the mtcars dataset from th...

2502 sym R (1088 sym/8 pcs) 17 img

Using Linear Regression to Predict Energy Output of a Power Plant

29.09.2015

In this article, I will show you how to fit a linear regression to predict the energy output at a Combined Cycle Power Plant(CCPP). The dataset is obtained from the UCI Machine Learning Repository. The dataset contains five columns, namely, Ambient Temperature (AT), Ambient Pressure (AP), Relative Humidity (RH), Exhaust Vacuum (EV), and net hourl...

6500 sym R (2274 sym/8 pcs) 14 img

Data manipulation with reshape2

09.10.2015

In this article, I will show you how you can use the reshape2 package to convert data from wide to long format and vice versa. It was written and is maintained by Hadley Wickham. Long format vs Wide format In wide format data, each column represents a different variable. For example, the mtcars dataset from the datasets package can be represented...

3682 sym R (3439 sym/7 pcs) 6 img

Using kNN Classifier to Predict Whether the Price of Stock Will Increase

23.10.2015

In this article, I will show you how to use the k-Nearest Neighbors algorithm (kNN for short) to predict whether price of Apple stock will increase or decrease. I obtained the data from Yahoo Finance. You can download the dataset here. What is the k-Nearest Neighbors algorithm? The kNN algorithm is a non-parametric algorithm that can be used for ...

4558 sym R (1156 sym/7 pcs) 8 img

Building Interactive Maps with Leaflet

07.11.2015

Leaflet is an JavaScript library for building interactive maps. RStudio released a package that allows us to build these maps in R! You can do some really cool things in Leaflet, and I will demonstrate a few of those below. Leaflet is compatible with Shiny apps and R Markdown documents. As mentioned on the RStudio page, the basic steps to create ...

3474 sym R (4364 sym/7 pcs) 14 img