Assuming that the image is created with ggplot save it thusly
ggsave(filename="YOUR_NAME.svg",
plot = last_plot(),
device = 'svg',
path = 'images',
scale = 1,
width = 6,
height = 4,
units = c("in"),
dpi = "retina",
limitsize = TRUE)
which can be simpler than fiddling with markdown/HTML/css