setwd("/shapefiles/uhf")
`enter code here`map<-readOGR(dsn=".",layer="UHF_42_DOHMH_2009")
`enter code here`plot(map)
`summary(map)`
coordinates(map)
proj4string(map)=CRS("+init=esri:102718")
map=spTransform(map,CRS("+proj=longlat +datum=WGS84"))
summary(map)
.
> summary(map)
Object of class SpatialPolygonsDataFrame
Coordinates:
min max
x 913090.8 1067310
y 120053.5 272932
Is projected: TRUE
proj4string :
[+proj=lcc +lat_1=40.66666666666666 +lat_2=41.03333333333333
+lat_0=40.16666666666666 +lon_0=-74 +x_0=300000 +y_0=0 +datum=NAD83
+units=us-ft +no_defs +ellps=GRS80 +towgs84=0,0,0]
Data attributes:
OBJECTID UHFCODE SHAPE_Leng SHAPE_Area
Min. : 1.0 Min. : 0.0 Min. : 34713 Min. : 35132269
1st Qu.:11.5 1st Qu.:203.5 1st Qu.: 55839 1st Qu.:101843450
Median :22.0 Median :303.0 Median : 73089 Median :164519524
Mean :22.0 Mean :281.7 Mean : 90960 Mean :194568186
3rd Qu.:32.5 3rd Qu.:403.5 3rd Qu.:113901 3rd Qu.:269127674
Max. :43.0 Max. :504.0 Max. :250903 Max. :731130742
UHF_NEIGH BOROUGH
Bayside - Little Neck : 1 Bronx : 7
Bedford Stuyvesant - Crown Heights: 1 Brooklyn :11
Bensonhurst - Bay Ridge : 1 Manhattan :10
Borough Park : 1 N/A : 1
Canarsie - Flatlands : 1 Queens :10
(Other) :37 Staten Island: 4
NA : 1
brooklyn<-subset(map, UHFCODE==205 | UHFCODE==206 | UHFCODE==209,)
str(brooklyn)
summary(brooklyn)
boundary<-as(brooklyn, "owin")
plot(boundary)
summary(boundary)
Window: polygonal boundary
4 separate polygons (no holes)
vertices area relative.area
polygon 1 16 3.35333e-06 0.000764
polygon 2 205 1.10311e-03 0.251000
polygon 3 173 1.69957e-03 0.387000
polygon 4 178 1.58568e-03 0.361000
enclosing rectangle: [-74.04249, -73.9536] x [40.58028, 40.67145] units
Window area = 0.00439172 square units
a<-as(brooklyn_tb, "ppp")
str(a)
summary(a)
a$window=boundary plot(a, pch=16)
summary(a$window)
BROOKLYN<-Kest(a, correction="trans")
plot(BROOKLYN)
My question is, what is the "relative.area" that appears after converting the shapefile to its own object?
I have to build the latitude and longitude of TB cases in this shapefile and run the Kest () function. I need to know which unit of measure is used to perform Kest () calculations? Is there a way to change units? What is the “r” unit in the Brooklyn section after running the Kest () function? I can’t post images because I don’t have enough “reputation” !!!! But here is a link to a potential K (r) graph: http://rgm3.lab.nig.ac.jp/RGM-files/R_CC/result/spatstat/thomas.estK.Rd_001_large.png