1

I am trying tmap for the first time and while making some maps on "view" mode the R graphics device pops up everytime I attempt to make an interactive plot. For instance:

library(tmap)
library(mapview)
data(World)

# just the map
tmap_mode("view")
qtm(World)
#The map gets displayed on my browser but an R empty device gets invoked as well.
#How can I avoid the R device from popping up?

However, that doesn't happen when using mapview:

mapview(World)
Salvador
  • 1,229
  • 1
  • 11
  • 19

1 Answers1

0

Digging in, the tmap:::pre_prepare_vp() function calls dev.size() here, which triggers the creation of a new device window. The function is called from here to determine the aspect ratio.

There doesn't seem to be any obvious way to avoid this; maybe worth posting an issue (possibly related to/the same as this one ?

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453