Big data: predicting future city solutions, Rand Hindi, CEO Snips

Video

R – Labels inside ggplots using directlabels

Standard

The other day I generated the following figure with ggplot2

plot

using the following code:

ggplot(dat, aes(x = Year, y = log10(sum), group = id, colour = id)) +
 geom_point() +
 geom_smooth() +
 labs(x = "", y = "")

Note that I used the “group” argument to plot both curves on the same figure. Similarly I used the “colour” argument to colorize each curve differently.

But instead of a legend I wanted to have labels on or near the curves. To do that I resorted to the “directlabels” package.

First I needed to install it after installing its dependency package “quadprog” and load ggplot2 & directlabels:

install.packages("quadprog") # dependency for directlabels
install.packages("directlabels", repo="http://r-forge.r-project.org")

library(ggplot2)
library(directlabels) # load "directlabels"

To plot the figure, I went on as before but instead I assigned the plot command to “p” which I then passed on to direct.label().

p <- ggplot(dat, aes(x = Year, y = log10(sum), group = id, colour = id)) +
 geom_point() +
 geom_smooth() +
 labs(x = "", y = "")
direct.label(p)

As you can see the direct.label() function took care of the legend and replaced it with labels on the curves:

plot

This is a really useful package.

If you found this post helpful please give it a like or share it somewhere in the digital universe.

TEDMED – One more reason to get a good night’s sleep

Standard

Research paper: Sleep Drives Metabolite Clearance from the Adult Brain, DOI: 10.1126/science.1241224

Important points:

  • Brain has no lymphatic system to clean it
  • During sleep brain cells seem to shrink
  • Cerebrospinal fluid (CSF) acts as a detoxing agent removing toxins built up while the brain is conscious.
  • CSF influx only happens during sleep. It is inhibited during wakefulness.

and we discovered that at the same time when the brain goes to sleep, the brain cells themselves seem to shrink, opening up spaces in between them, allowing [cerebrospinal fluid – CSF] fluid to rush through and allowing waste to be cleared out.

But our most surprising finding was that all of this, everything I just told you about, with all this fluid rushing through the brain, it’s only happening in the sleeping brain.

Education and Neuroscience

Quote

With new findings from neuroscience catching the headlines every day, surely we can tap into these results to improve our education system? The Education and Neuroscience Initiative hopes to address this question – this joint programme of work between the Wellcome Trust and the Education Endowment Foundation (EEF) aims to: build research and expertise at the interface between neuroscience and education; support the responsible transfer of technologies, resources and practices based upon neuroscience into education; and help teachers to be able to make informed choices based upon the best available evidence. In this post we explain why we are embarking on this work, share some of the learning we’ve gained in the process, and we invite a wider conversation on this topic.

via ThInk : Education and Neuroscience.

Relevant: Education Endowment Foundation

Visualized statistical history of the world (BBC Four & TED)

Standard

Today I share two videos with you. The first is an episode of BBC Four’s “The Joy of Stats”. The other is a TED talk.
Both are presented by Hans Rosling.

In these videos Hans Rosling visually demonstrates statistical data on the world’s wealth, health, family size, & daily income among several others by continent and country. The demonstrations are amazing. Enjoy

Continue reading