Hi all,
As I already mentioned, this is the problem due to one extra county "yellowstone national" in montana. I am trying to plot Montana and wyoming together for further analysis.. At the last line, index does not match between  counties$names and data$co(see NA below). I know this is is due to the extra county of montana. I would appreciate any help in this.
I attached data if u want to have a look.
library(maps)
data<-read.csv("2data.csv",header=TRUE)
 dim(data)#79 rows
[1] 79  6
data[1,]#first row
    state     county        Y        X Longitude Latitude
1 Montana Beaverhead 5.393363 7.893883 -112.8929 45.13386
 data$co <- paste(tolower(data$state),tolower(data$county), sep='.')
 counties <- map("county",c("montana","wyoming"), fill=T, plot=F)
 commaReplace <- function(x) {
+ return(gsub(",",".", x))
+ }
 counties$names <- sapply(counties$names, commaReplace, simplify=TRUE)
 names(counties$names) <- NULL
 length(counties$names) 
[1] 80
 index <- match(counties$names,data$co)
 index
 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
[26] 26 27 29 28 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
[51] 51 52 53 54 55 56 NA 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
[76] 75 76 77 78 79
#####
Thanks in advance,
Milan

	[[alternative HTML version deleted]]

