skip to Main Content

Insert image (file or R object) into existing html file from R script

I include two ggplotly() graphics in a html file, eg. library(ggplot2) library(plotly) library(htmltools) g1 <- ggplot(data=data.frame(x=1:10, y=1:10)) + geom_point(aes(x=x, y=y)) g2 <- ggplot(data=data.frame(x=11:20, y=1:10)) + geom_point(aes(x=x, y=y)) l1 <- ggplotly(g1) l2 <- ggplotly(g2) htmltools::save_html(htmltools::tagList(l1,l2), file ="index.html") And now want to…

VIEW QUESTION

ggplot2: How to add padding/gap to segment end points – Ubuntu

library(ggplot2) dfr1 <- data.frame(x=c(1,2),y=c(1,2)) dfr2 <- data.frame(x=1,xend=2,y=1,yend=2) ggplot()+ geom_point(data=dfr1,aes(x,y),size=6)+ geom_segment(data=dfr2,aes(x=xend,y=yend,xend=x,yend=y), color="red",arrow = arrow(length=unit(0.10,"cm"), ends="first", type = "closed"))+ coord_fixed()+ theme_minimal() I would like to add some padding/gap to the start and end of the segment so that they do not overlap…

VIEW QUESTION
Back To Top
Search