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.

Assorted links – Apprendre le français

Standard
This is a list of resources for learning French. If you find a broken link please report it in the comments.

First, as taken from the “Apprendre le français avec TV5MONDE” website:

10 MINUTES OF FRENCH A DAY

  • Watch the TV5MONDE channel in your country:www.tv5monde.com/reception.
  • Check your knowledge of conjugation on the TV5MONDE French language page using the multifunction dictionary, test your spelling with letter games, listen to Merci Professeur’s lessons.
  • Learn current vocabulary with the 7 jours sur la planète application. Each week, memorise new vocabulary by playing with about forty words taken from television reports.
Audiovisuel – Audio, Video, et Podcasts

Sites

Apps

Products

Assorted links – Massive Open Online Course

Link

CourseTalk is a nice search engine for MOOCs

Massive Open Online Courses – MOOCS

Coursera
edX
France Université Numérique
Udacity
Udemy
CodeAcademy
OpenAcademy

FutureLearn

Complexity Explorer (Mathematics for Complex Systems)

About Massive Open Online Course, Wikipedia

Extension Schools

Harvard Extension School – can earn you credit (tuition $1250 ~ $2200)
Stanford Online

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.