Skip to main content
4 of 7
added 488 characters in body
peter
  • 31
  • 3

Is there R method similar to ArcGIS StandardDistance_stats?

I am finding some methods that can provide simple output.

I found a useful method StandardDistance_stats in ARCGIS, but the result is not what i am looking for, I only need the result of a lat/lng point and the size of the circle in number form, so I can plot it to my web map.

enter image description here

Now I am using geomean in geosphere package, it gives the mean of lat/lng points but still missing the size of the circle.

Edit: I found a solution for it, but I am stuck in import R script into Java

d <- read.csv(file="./points.csv", header=TRUE, sep=",")
x <- d$lng
y <- d$lat
w <- d$weight
df <- data.frame(x,y)
mean = geomean(df,w)
.sdd <- function(t,mean) {
    x <- t$lng
    y <- t$lat
    x <- x-mean[1]
    y <- y-mean[2]
    x <- x*x
    y <- y*y
    result <- (Reduce("+",x)/length(x))+ (Reduce("+",y)/length(y))
    result <- sqrt(result)
    return(result)
}
.sdd(d,mean)
peter
  • 31
  • 3