[R] Help with Radius problem

Jim Lemon drj|m|emon @end|ng |rom gm@||@com
Wed May 13 08:38:47 CEST 2020


Hi Bill,
A while ago I devised a couple of functions to accumulate millions of
geographic locations of events and then display the resulting matrix
of values on an existing plot. This may be of use to you, at least in
the visualization of the density of the locations. As your example
data only included a few points, the resulting plot looks pretty
chunky as I had to use a large symbol to make the cells with non-zero
counts obvious.

# read in your sample data
source("wp_data.R")
library(plotrix)
geomat<-makeDensityMatrix(geodat[,c("latitude","longitude")],
xlim=range(geodat$longitude),ylim=range(geodat$latitude))
# Range of density (>0) - 1.119816 3.922018
latlim<-range(geodat$latitude)
lonlim<-range(geodat$longitude)
library(maps)
map("world",xlim=lonlim,ylim=latlim)
axis(1)
axis(2)
densityGrid(geomat,range.cex=c(1,5),xlim=lonlim,ylim=latlim,
 red=c(0.5,1),green=0,blue=0,pch=15)

Jim

On Wed, May 13, 2020 at 10:57 AM Poling, William via R-help
<r-help using r-project.org> wrote:
>
> #RStudio Version Version 1.2.1335
> sessionInfo()
> # R version 4.0.0 Patched (2020-05-03 r78349)
> #Platform: x86_64-w64-mingw32/x64 (64-bit)
> #Running under: Windows 10 x64 (build 17763)
>
> Hello I am trying to figure out how to create concentration of ID's in the following data, based on determining the highest concentration in the smallest radius area based on Longitude and Latitude (geo location)
>
> I have reviewed many websites looking for a function or tutorial, (if you are aware of either please let me know)
>



More information about the R-help mailing list