title: Add labels to a map plot
body: <p>I am trying to add labels in a map plot using R.
  I need to put a which condition to the labels. Have tried multiple options but to no avail.</p>
  
  <pre><code>png(filename="D:\\dm analysis3.png", width=959, height=593)
  plot(zip,col=ifelse(zip@data$Seg=="Super Top",'Dark Green',
                        ifelse(zip@data$Seg=="Top Performer",'Light Green',
                      ifelse(zip@data$Seg=="Average Performer",'Yellow',
                             ifelse(zip@data$Seg=="Poor Performer",'Red',
                                    ifelse(zip@data$Seg=="Zero returns",'Dark Red',
                                           'Grey'))))),
       border=ifelse(zip@data$Seg=="Super Top",'Dark Green',
                     ifelse(zip@data$Seg=="Top Performer",'Light Green',
                            ifelse(zip@data$Seg=="Average Performer",'Yellow',
                                   ifelse(zip@data$Seg=="Poor Performer",'Red',
                                          ifelse(zip@data$Seg=="Zero returns",'Dark Red',
                                                 'Grey'))))),
       bty="n")
  
  with(subset(zip@data,zip@data$flag=="Y"),
       text(zip@data,labels=as.character(zip@data$code)))
  
  map('state', plot = TRUE, fill = FALSE,add=TRUE)
  dev.off()
  </code></pre>
  
  <p>Can anyone tell me how to print labels, i am unable to do so</p>