title: Convert map data to data frame using fortify {ggplot2} for spatial objects in R
body: <p>I use to be able to run this script without any problem, but now the fortify {ggplot2} command gives me an error message. Any hint of what might be the problem would be great! I used the fortify command to be able to geom_map the shapefile using ggplot2.</p>
  
  <p>Below is my script and link for downloading the data.</p>
  
  <pre><code>#######################################################
  #######################################################
  rm(list = ls(all = TRUE))#clear workspace
  getwd()
  #upload packages
  library(maps)
  library(mapdata)
  library(gridExtra)
  library(rgdal)
  library(rgeos)
  library(ggplot2)
  library(sp)
  library(maptools)
  gpclibPermit()
  
  #setwd(".../FAO") FAO data are major fishing area divisions
  &gt; FAO&lt;- readOGR(dsn="fao", layer="World_Fao_Zones")
  OGR data source with driver: ESRI Shapefile 
  Source: "fao", layer: "World_Fao_Zones"
  with 19 features and 1 fields
  Feature type: wkbPolygon with 2 dimensions
  &gt; names(FAO);dim(FAO)
  [1] "zone"
  [1] 19  1
  &gt; str(FAO,max.level=2)
  Formal class 'SpatialPolygonsDataFrame' [package "sp"] with 5 slots
    ..@ data       :'data.frame': 19 obs. of  1 variable:
    ..@ polygons   :List of 19
    ..@ plotOrder  : int [1:19] 18 2 17 4 12 3 13 11 5 6 ...
    ..@ bbox       : num [1:2, 1:2] -180 -85.5 180 90
    .. ..- attr(*, "dimnames")=List of 2
    ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slots
  &gt; plot(FAO)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/9HONT.jpg" alt="FAO plot"></p>
  
  <pre><code>FAO@data$id = rownames(FAO@data)
  FAO.df &lt;- as.data.frame(FAO)# convert shapefile to dataframe to merge later
  &gt; FAO_fort &lt;- fortify(FAO, region="id")# fortify to plot with ggplot2 
  Error in function (classes, fdef, mtable)  : 
    unable to find an inherited method for function "proj4string", for signature "NULL"
  </code></pre>
  
  <p>Here's a link to download the data <a href="http://dl.dropbox.com/u/12716426/fao.zip" rel="nofollow noreferrer">FAO data</a>.
  Thank you!</p>