Depending on the intended use of the svg graphic, there are options.
The simplest is for plot produced by ggplot2 where you can use the ggsave() function (see help(ggsave) for details.
The {Cairo} package will also output high-quality svg.
For svg where highest resolution is not required, the {svglite} package is another choice.