Some days ago i’ve got stucked in what appears to be a simple task: read some El Nino data, and then plot it. The problem was the data file format, which you can find here: El Nino Data.
There’s a mix between ‘white space’ and ‘.’ characters, so
read.table won’t work. It happens this is called a fixed width format, and R has the mighty
read.fwf() function to save us a lot of work. So let’s put this into action together with ggplot2!
The code below shows how to use the
read.fwf() function and then it’s pure ggplot2 stuff. Enjoy it!