Hi,
I need to create a weight matrix in R for point dataset of 78,000
observations from a shapefile( from ArcGIS) which has both sets of
longitudes and latitudes and X-Y coordinates (based on state plane feet).
So far I projected the dataset in ESRI coordinates using rgdal maptools.
I keep getting error message as below:
shapeR_SP <-spTransform(shapeR, CRS("+init=ESRI:102730"))
> IDs <-row.names(as(shapeR_SP, "data.frame"))
> coords<-coordinates(shapeR_SP)
> shapeR_nbq <-poly2nb(shapeR_SP)
Error: extends(class(pl), "SpatialPolygons") is not TRUE
> shapeR_kn6 <-knn2nb(knearneigh(coords, k=6), row.names=IDs)
Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return
= TRUE, :
there is no package called 'RANN'
where is 'RANN' from?!
The outcome goal is to address the spatial dependence in hedonic model with
house sales transaction study. I like to run the spatial dependence test so
that I can refine the spatial regession analysis.
I would appreciate any suggestions and/or answers to the following
questions:
1. What is the sample size capacity of R (weight matrix size)? This
is the main reason I switched back to R from Stata. Is there any means to
achieve the outcomes I am looking for?
2. Do I need to install.view ("Spatial)? When I tried to
install.view("Spatial"), I've been getting a message that that package is
not available for R 3.0 which I am using - R studio. Is "Spatial" different
from "spatial" package? Do I need to find a different version of R?
3. Is there a better to achieve the outcome? For instance, using
GeoDa to create a weight matrix?
Thank you.
Susan Shim Gorelick
[[alternative HTML version deleted]]