I\'d like to do a small program in R for interactive visualization and modification of some raster datasets, seen as colored images. The user should open a file (from the termin
I give you a simple example of how to do it in R without external Java libraries, if you want Javan's features you can adapt it, but each java graphics library is different and I have never done anything similar.
set.seed(123)
mydata <- data.frame(x = runif(10), y = runif(10))
edit_plot <- function(data) {
plot(data)
sel <- locator(n = 1)
if(is.null(sel)) return(TRUE)
dd <- (data$x - sel$x)^2 + (data$y - sel$y)^2
data[which.min(dd),] <- edit(data[which.min(dd),])
r <- edit_plot(data)
if(r) return(TRUE)
}
edit_plot(mydata)
To exit press Esc when locator is active.