data-raw/AntiSpatialForMalcolm.r

library(sp)
library(rgdal)
library(r4maps)




#check existing crs for a spatial object i.e. x
x <- ab
class(x)

#If is a spatial object and it has a CRS, then transform

#Code to Transform x to WGS84


#Convert spatialobject.data.frame to a dataframe, with Lat Long fieds
LL <- getlatlong(ab)

abLL <- cbind(as.data.frame(x.LatLong),coordinates(x.LatLong))
colnames(abLL)[44:45] <- c("Long","Lat")


table(abLL$blockno)

pick <- which((abLL$blockno == 13) & (abLL$zone == "E") &
              (abLL$blkg2018 > 0))

bx <- abLL[pick,]
# b13$Long <- round(b13$Long,3)
# b13$Lat <- round(b13$Lat,3)
properties(bx)

plotprep(width=7,height=7)

leftlong <- 146.85;  rightlong <- 147.05
uplat <- -43.5;  downlat <- -43.65
plotsessf(leftlong,rightlong,uplat,downlat)
addpoints(bx,incol=rgb(1,0,0,1/5),incex=0.75)
dim(bx)

plotprep(width=6,height=4)
par(mfrow=c(1,1),mai=c(0.45,0.45,0.05,0.05),oma=c(0.0,0,0.0,0.0))
par(cex=0.85, mgp=c(1.35,0.35,0), font.axis=7,font=7,font.lab=7)
plot(bx$mins2018,(bx$blkg2018),type="p",pch=16,col=2)

geomean(sqrt(bx$blkg2018))^2
mean(bx$blkg2018)
median(bx$blkg2018)
geomean(bx$blkg2018)
haddonm/abspatial documentation built on June 7, 2019, 9:54 a.m.