Data everywhere! – Introduction to Quandl

Economists need data. In this post I want to introduce those of you who don’t know it to a magnificent data source – Quandl is an open source website that indexes a huge range of data – over 6,000,000 data sets according to the website – for almost every country on Earth. The bulk of these data appear to be financial but there is a wealth of socioeconomic data for many countries (see here for their list of health topics, for example).

One of the most useful things about Quandl is its ability to provide that data directly into a usable format. You can even download any of the datasets straight into R; here, I will show you how.

Let’s look at total health spending as a proportion of GDP in the UK. We first find the dataset in Quandl (which is found here) and then click download where we have a number of options. In this case let’s opt for R.


We copy and paste the code into R

df<-read.csv('', colClasses=c('Year'='Date'))

And then we plot

ggplot(aes(Year,Value),data=df)+theme_bw()+labs(x="Year",y="Healthcare spending as % of GDP")+geom_line()

Simple. There is also an R package available in CRAN that enables you to access data from Quandl without using the website and customising the data set (selecting variables and dates). I suspect that this will make finding appropriate data much easier in future.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s