[R-sig-Geo] Drawing Maps

Michael Sumner mdsumner at gmail.com
Wed Dec 15 07:17:55 CET 2010


You need to quote the layer  since R is looking for a variable of that name:

foo <- readOGR(dsn = "D:/Documents and Settings/kevinwang/My
Documents/SMS/ASGC", layer = "LGA10aAust")

That's what "object 'LGA10aAust' not found" means.

Compare:

print(v.unlikely.name)

with

v.name <- "quoted text"
print(v.name)

So, you otherwise could do this:

layername <- "LGA10aAust"

foo <- readOGR(dsn = "D:/Documents and Settings/kevinwang/My
Documents/SMS/ASGC", layer = layername)

This is basic R understanding so work on some familiarity with text
strings and objects first if you get bogged down in fairly specialist
functions like these ones.

Good luck!


On Wed, Dec 15, 2010 at 5:01 PM, Wang, Kevin (SYD)
<kevinwang at kpmg.com.au> wrote:
> Hi,
>
> I'm just starting to learn map drawing, so I do apologise if the
> questions are very simple.
>
> I've downloaded
>        Local Government Area ASGC Ed 2010 Digital Boundaries in MapInfo
> Interchange Format
>        Local Government Area ASGC Ed 2010 Digital Boundaries in ESRI
> Shapefile Format
>
> From
> http://www.abs.gov.au/AUSSTATS/abs@.nsf/DetailsPage/1259.0.30.001July%20
> 2010?OpenDocument , and unzipped them into a directory.  I then tried:
>        > library(rgdal)
>        > foo <- readOGR(dsn = "D:/Documents and Settings/kevinwang/My
> Documents/SMS/ASGC", layer = LGA10aAust)
>        Error in nchar(layer) : object 'LGA10aAust' not found
>
> Unfortunately I don't quite understand what the error message means.
>
> My questions:
> *       Does anyone know a good reference where I can learn the basics
> of mappings in general (e.g. what's a shapefile?  Difference bewteen
> MapInfo and ESRI...etc)
> *       Is R better at handling MapInfo or ESRI?
> *       Is there a good reference (book or online article) on drawing
> maps in R?  I found http://medipe.psu.ac.th/~edward/R/MapTools.pdf but
> can't seem to see the read.shape() function in maptools package.
>
> Thanks in advance for the help!  I'm looking forward to do some maps in
> R :).
>
> 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 at kpmg.com.au <mailto:kevinwang at 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]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
Michael Sumner
Institute for Marine and Antarctic Studies, University of Tasmania
Hobart, Australia
e-mail: mdsumner at gmail.com



More information about the R-sig-Geo mailing list