Loading messy data sets in R

To look at how to import data, clean it and get some useful information out of it, we'll be looking at a messy data set containing information from world wide disasters in the last 100 years. The data can be found here.

After saving it we want to import it in R. It is tab separated and includes header, sor this might be a good try:

> dis

R trips up because there are more data columns than names in the header. We can import the data easily without the header, remove the last column and add the header information in R to the data frame:

> dis  dis  names(dis) 

Leave a Reply

Your email address will not be published. Required fields are marked *