We have some drawings of world maps with data, made using R's leaflet package. Is it possible to export the result into svg format, in order to get the objects separable to tune the layout further, let's say, in inkscape?
Here is the minimal example of data from another question
# necessary libraries
library("leaflet")
library("htmltools")
library("leaflet.minicharts")
# generated some data
basins <- read.table(text="basin,lat,lon,res.density,rel.area
Central Sumatra,1,96,16.7,75
North Sea,58.4,2,20,24
Maracaibo basin,9,-71,74.4,14.3
Los Angeles,33,-118,31.2,32", header=T, sep=",")
# plotting itself
m2<- leaflet(data = basins) %>%
addTiles() %>%
addCircleMarkers(~lon, ~lat ,radius=0,label=~htmlEscape(basin),labelOptions=labelOptions(noHide=T,textOnly=TRUE,direction="bottom", offset=c(0,5))) %>%
addMinicharts(basins$lon, basins$lat, type="bar", chartdata = basins[, c("res.density", "rel.area")], width = 50, height = 60,legend=FALSE,showLabels=TRUE) %>%
addLegend(position='bottomleft',colors=c("#1f77b4","#ff7f0e"),opacity=0.8,labels=c("some strange value in thousands/km2","another value measured in km2" ))
m2
Trying to export it as usual for plots:
svg("file.svg")
m2
dev.off()
does not work. I understand that this is some another type of object than generated by plot() commands. Is it ever treatable as vectors?