Skip to content

Getting unknown error trying to plot spatial data

2 messages · mjkatsaros, Jim Lemon

#
Hi there! I'm following an awesome guide to working with spatial data
(http://www.frankdavenport.com/blog/2012/6/19/notes-from-a-recent-spatial-r-class-i-gave.html)
and am running into an error that I can't figure out how to fix.

Disclaimer: I am very much an R n00b

Here is the r script I am running:
https://dl.dropbox.com/u/28231177/This%20Should%20Work.R

data: https://dl.dropbox.com/u/28231177/my_data.csv

shapefile: https://dl.dropbox.com/u/28231177/sfzipcodes.zip

I am getting two errors:
*Using OBJECTID to define regions.*
*Error in `$<-.data.frame`(`*tmp*`, "OBJECTID", value = integer(0)) : 
  replacement has 0 rows, data has 16249*
*Error in unit(x, default.units) : 'x' and 'units' must have length > 0*

Anybody have any idea what is happening here or how to resolve this?

Thanks!!!!



--
View this message in context: http://r.789695.n4.nabble.com/Getting-unknown-error-trying-to-plot-spatial-data-tp4639179.html
Sent from the R help mailing list archive at Nabble.com.
#
On 08/05/2012 05:09 AM, mjkatsaros wrote:
Hi mjkatsaros,
The data file doesn't have a column labelled "OBJECTID". I would try 
renaming the "zip" column to "OBJECTID".

Jim