Hi all,

I've managed to draw a map using the following code:
	lga1 <- readShapePoly("D:/Documents and Settings/kevinwang/My
Documents/SMS/ASGC/LGA10aAust", IDvar = "LGA_CODE10")
	plot(lga1[lga1$STATE_CODE == 7,], border="blue")
	title(main = "NT LGA Division")
	text(coordinates(lga1[lga1$STATE_CODE == 7,]), labels =
sapply(slot(lga1[lga1$STATE_CODE == 7,], "polygons"),
	
function(i) slot(i, "ID")), cex=0.6)

This gives me a map of Northern Territory (Australia), with local
government division LGA and the code for the LGAs in each LGA.

However, instead of the LGA code, I'm trying to use LGA names (which is
in a variable called LGA_NAME10) instead.  But when I tried to change
the IDvar I got:
	> lga1 <- readShapePoly("D:/Documents and Settings/kevinwang/My
Documents/SMS/ASGC/LGA10aAust", IDvar = "LGA_NAME10")
	Error in `row.names<-.data.frame`(`*tmp*`, value = c("Albury
(C)", "Armidale Dumaresq (A)",  : 
	  duplicate 'row.names' are not allowed
	In addition: Warning message:
	non-unique value when setting 'row.names': 'Campbelltown (C)' 

My guess is that there are duplicated names in LGA_NAME10 variable.  So
I'm wondering if it's possible to specify "LGA_NAME10" in the text()
function instead?

Thanks in advance for the help!

Cheers
Kevin



Kevin Wang
Senior Adviser, Government Advisory Services
Advisory

KPMG
10 Shelley Street
Sydney  NSW  2000  Australia

Tel 	+61 2 9335 8282
Fax	+61 2 9335 7001
Mob	0404 518 301
kevinwang@kpmg.com.au <mailto:kevinwang@kpmg.com.au > 

kpmg.com.au <http://kpmg.com.au/> 

Best Accounting Firm - BRW Client Choice Awards 2010

Protect the environment: please think before you print




	[[alternative HTML version deleted]]

