# Assessing mapdata world coastline

**Dan Kelley Blog/R**, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

# Introduction

The `mapdata`

R package contains a coastline called `worldHires`

which is contained within a text file with a bit over 2 million lines. Since the `coastlineWorldFine`

dataset in the `ocedata`

package contains about 0.5 million points, I thought I would explore how much better the `mapdata`

coastline might be.

# Methods

First, I wrote the following C file to translate the data to something that R can read.

| `#include ` |

Then, I created a datafile for plotting. It turns out that `mapdata`

numbers are in radians, so a conversion was required.

I plotted this “new” dataset and the “old” one (containined in `ocedata`

) and the results are shown below.

# Results

# Conclusions

There are some differences between the two, but nothing dramatic (e.g. no Northwest Arm of Halifax Harbour). Certainly it would be difficult to argue for exapanding the memory footprint of `ocedata`

by a factor of 4.

**leave a comment**for the author, please follow the link and comment on their blog:

**Dan Kelley Blog/R**.

R-bloggers.com offers

**daily e-mail updates**about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.