Re: [R] Leaflet maps. Nudging co-incident markers

2018-01-20 Thread Jim Lemon
Hi Gavin, Here's a sort of brute force way to nudge points. Might be helpful. nudge<-function(x,y,away=0.1,tol=0.01) { dimx<-dim(x) if(missing(y) && !is.null(dimx)) { y<-x[,2] x<-x[,1] } xlen<-length(x) if(xlen != length(y)) stop("x and y must be the same length.") for(i in 1:xlen) {

[R] Leaflet maps. Nudging co-incident markers

2018-01-19 Thread Gavin Rudge (Institute of Applied Health Research)
I have a dataset showing points, with a category for each point and its location. I simply want to display my points, in a way that users can toggle the points on and off by category. Where I have two objects in the same category I'd like to display them nudged to appear as two distinct, but