Skip to content

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

[code language=”r”]df<-read.csv(‘’, colClasses=c(‘Year’=’Date’))[/code]

And then we plot

[code language=”r”]ggplot(aes(Year,Value),data=df)+theme_bw()+labs(x=”Year”,y=”Healthcare spending as % of GDP”)+geom_line()[/code]

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.

We now have a newsletter!

Sign up to receive updates about the blog and the wider health economics world.

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Join the conversation, add a commentx