Category: Data

Announcing ShinyTester – a package that helps you build Shiny apps

Shiny is awesome, but can be a bit daunting and easy to make mistakes in. I recently came back to Shiny after a hiatus of a few years and it was much more challenging than I feel comfortable admitting. I was making bonehead mistakes like writing something instead of output$something, confusing where to put Output commands vs Render commands, etc. I would… Read more →

Pop quiz! What is this chart saying?

I have been reading more and more about how people can’t interpret charts… which kinda never occurred to me, if I’m gonna be very honest.  Anyway, it kind of made me think of actually testing people informally, to see for myself. So I’ve been doing just that: showing colleagues, friends, etc a chart that we created interactively during the first Accra… Read more →

Heart-shaped wordcloud, celebrating Colombia peace treaty

This is a lightening quick post just providing the script to draw a heart-shaped wordcloud, using the awesome wordcloud2 package. See the resulting image here:   Apparently, the original code allows you to fit a wordcloud to any shape, even custom shapes, but I didn’t find that functionality pushed out into R yet (a peace sign would have been awesome… Read more →

Track your local R scheduled tasks with CommandCenter2000!!!

There are many ways to automate your scripts running, for example using RScript, or in-R itself (and now even as an add-in for RStudio) (check all here). But after a while, it can get a bit overwhelming to track tasks and ensure they are firing as planned. In order to address this, I have developed some futuristic advanced tech that lets us… Read more →

I’m leading the Accra R-User Meetups!

I am not sure how, but I found Data Science Africa, whose mission it is to promote data science in Africa. For now, they are limited to organizing and running meetups across Africa, mostly focused on R, although there are higher albeit more ambitious targets. Anyway, since I’m in Accra, I contacted them to see if I could help in… Read more →

Make dashboard Tiles/Notecards in R

Update!! Due to the popularity of this script, I released it as a package. To install it, use: devtools::install_github(“mexindian/TileMaker”) ———————————————————– Dashboard Tiles/Notecards are a great way to visualize just one number, and make it big and pretty. They can emphasize results in an easily digestible and colourful format. I was surprised that there was no way to create tiles offline… Read more →

KPI dashboard in R with animated icons

So Key Performance Indicators (KPIs) are all the rage in the dashboarding community… well everywhere really. The premise is simple… check a list of measurements against targets and show how they compare using some kind of visualization. I haven’t yet seen, however, a version that can utilize animated icons to display indicators that REALLY need attention. So here you go, a… Read more →

I’m proudly featured on r-bloggers!

I am proud to announce that with a little bit of encouraging from friends, I submitted my blog for inclusion in the prestigious r-bloggers and it was accepted! r-bloggers is the biggest roll up for high quality r related blogs and articles. It is actively maintained and thus is a great place to keep visiting to keep your finger on… Read more →

R Tagosphere!

This post explores the inter-relationships of StackOverflow Tags for R-related questions. So I grabbed all the questions tagged with “r”, took the other tags in each question and made some network charts that show how often each tag is seen with the other tags. The point is to see the empirical relationships that develop as people organically describe their problems with R. Full… Read more →

10 things you didn’t know about taxi costs in Accra

  “… but I paid 10 yesterday!” Having just arrived in Accra, Amit and I were trying to wrap our heads around taxi prices. We knew that we had to negotiate with the taxi driver but often the agreed-upon price kinda didn’t make sense…at all. Our first hypothesis was that the price was completely random! Then we noticed we tended to… Read more →

Clickable list of the best animations since 1900, gathered the geek way.

In the midst of our random data exploration, Laure and I started playing around with Hadley’s movies dataset and noticed that there were a lot of old cartoon animations… I mean REALLY old. So we got excited and wondered if we could find Youtube links for all these old animations. Indeed we could! Here’s how we did it. As always, the full analysis… Read more →

Locations for 75000 dams

The last task I performed for AQUASTAT was to try to find the best way to estimate the anthropogenic evaporation from dams. There will be a paper coming out soon, but in the meantime, I provide one of the fun outputs, a map of 75000 dams! ok okok… it’s not REALLY 75000 dams, this is an duplicate-containing amalgam of: AQUASTAT dams… Read more →

Chick flicks vs action movies!

I co-wrote this analysis with Laure Belotti to identify the difference between movie scripts for chick flicks and action movies using sentiment analysis, among other stuff. Rather than creating a blog post, we made a freestanding webpage because I wanted to play around w/ bootstrap and make it pretty and stuff. Anyway, the analysis is here: Leave comments below! Read more →

Sentiment analysis on my girlfriend’s text messages

When I told my friends that I wanted to give my girlfriend an infographic of us (centered around a sentimental analysis of our texts) as a gift for our first anniversary, most of them told me that was a terrible idea. Yeah… well… CHALLENGE ACCEPTED!! Without further ado, this is what love looks like: What… um…. what are we looking… Read more →

Excel is how I do maps…

Following the footsteps of this cool post I saw by JohnNelsonIDV, I wanted to try to and make a map using Excel. Fast forward 2 days and the opportunity came up. Lo and behold, a Map of Reference Evapotranspiration built in Excel! Instructions: Read data file into Excel (skip top rows with metadata), make sure to delimit correctly so that each… Read more →

Irrigated Crop Calendar Vizualisation

Visualizations made for FAO AQUASTAT: After individual Irrigated Crop Calendars for all countries were combined, it allowed for some interesting analysis of global irrigation. These included “The Big Picture” (at two levels of resolution), as well as viewing irrigation by region and by crop. All explanations and visualizations on: Read more →

Simplified renewable water resources, visualized

A visualization prepared for FAO AQUASTAT: In an interest to simplify the information about renewable water resources in all countries in the world, we prepared simplified visualizations of water flows through a country. Please navigate to the AQUASTAT Water Resources page and use the “Figures” dropdown to see the flow for each country (as well as the definitions of the abbreviations. Read more →

The Reddit effect…

So I had a happy little blog… no one really paid attention, but I didn’t much care because I was happy. And then I posted one of my visualizations to reddit. This is what happened: (None of the log analyzers I found would make a plot like this so I made it myself by parsing the log file itself, script is on github). So… Read more →

Irrigation area treemaps

These visualizations were performed for FAO AQUASTAT. These treemap charts allow for hierarchical organization of information of different types. In the image above, for example, the irrigation areas for each country are represented as the big boxes, within which the technology utilization is displayed in different colors. This allows users to see a large amount of information quickly. View more… Read more →

Transboundary surface water flow

A visualization generated for AQUASTAT of FAO. Two types of charts were prepared: Sankey and Network. The Sankey plots allow for an ‘automatic sorting’ of countries based on who is the water tower and who is the water source. This visualization is useful to demonstrate where a country falls on this continuum. The network plot shows the automatic arrangement of countries with their ‘water-neighbours’ without being… Read more →

Chord progressions of 5 000 songs!

Update: Full analysis and everything you need at my github The database contains analyses of over 5000 songs*. These analyses are uploaded by users and allow for all these songs to be analyzed in bulk, as well as individually. One of these ‘all song’ analyses enables users to gather chord progressions on ALL songs (see the analysis file… Read more →

Best way to make a custom palette with ggplot2

      A better way to pick colours with ggplot2 First, get the excellent package by Marco D Visser: library(devtools) install_github(“MarcoDVisser/choosecolor”) call it library(choosecolor) This lets us interactively pick colors ourselves. Just for fun and to get the hang of it, experiment with color.choose() now make a palette. In the syntax below means that you get to pick 4… Read more →

Excel basics

Most of the things posted on this page will make reference to Visual Basic for Applications (VBA). How do you get to the Visual Basic Editor? Excel versions prior to 2007: Under the Tools menu, go to Macros, and the option should be there. Excel 2007: Available through the Developer tab on the ribbon. If you don’t see a developer tab: Add the Developer tab… Read more →

Human armature from d3Network!

So a little bit of R, a little bit of d3Network and boom! Instant interactive html human!     Code to make your own or edit as you see fit: library(d3Network) Nodes <- c( “Head”, “Sternum”, “Shoulder.r”, “Shoulder.l”, # 0 1 2 3 “Elbow.r”, “Elbow.l”, “Wrist.r”, “Wrist.l”, # 4 5 6 7 “rib.r”, “hip.c”, “hip.r”, “hip.l”, # 8 9 10… Read more →

Wordcloud generator

Using Shiny and R, we made a super-customizable wordcloud maker that takes any .txt file you feed it, and creates a wordcloud just how you like it (without needing to give your email to creepy people). Check it out! (If you’re an R corpus geek… why doesn’t remove-words remove the top word? Super weird, no?) Visit the page and pull-request… Read more →

kml maker for Excel -> Google Earth

I made a userform that quickly and easily allows you to make a kml file that’s readable by google earth based on some excel dataset that has coordinates. Features: Simple and advanced modes userform for convenience Icons change when highlighted Allows html to be passed to popup contents, everything is customizable Issue a default icon, and change icons for specific… Read more →

Change lists into tables and tables into lists

Designed a userform that converts dimension formats, i.e. information from tabular format to list (or flat) format, and viceversa. Some options include preserving formatting or not, as well as including blank cells or not. >>Form is here:Dim changer userform >>Excel file with embedded form and a macro to make the form pop up is here:Dim_changer >>Tutorial is here: Code… Read more →

Search or filter through controls in a userform

This bit might be useful if you have a lot of controls on a form, and need a quick way to highlight them. This post supports the video: I uploaded a video tutorial, you can see it here (please view in fullscreen mode, or watch the video in youtube by clicking on the youtube logo):[]. Download the file here (Search on… Read more →

%d bloggers like this: