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 terminal it's OK), plot it, select the points to edit with mouse clicks, and insert the new values.
So far I achieved that easily. I use the plot()
function from the raster
package to visualize the plot, then click()
to select the points and edit their value via the terminal.
I'd like to add the ability to show the values on mouse over. I've searched for ways on how to do this, but this doesn't seem to be possible with the standard R packages. Is this correct?
In this case, I may be forced to use external packages, such as gGobi, iPlots, Shiny or Plotly. However, I'd greatly prefer to KISS and use only "standard" graphics tools, such as the raster plot()
function or maybe trellis graphics objects (e.g. from rasterVis
).
I understand a Shiny app would probably be best, but it takes lots of time to learn and perfect.
With
leaflet
,mapview
, andleafem
you can achieve something like this:Putting that in a shiny app you get:
The following example illustrates the idea of converting the raster to Simple Features / Shapefiles. Its not realy useable for big Files, but the labels can be designed individually, the data is editable and can easily be shown in a Table.