My problem is exactly like this link enter link description here
I used facet but I got this erorr:
Warning: Error in combine_vars: At least one layer must contain all faceting variables: w3.
- Plot is missing
w3 - Layer 1 is missing
w3
this is a part of my code (I have written only server side):
output$fancyPlot <- renderPlotly({
s = input$fancyTable_rows_selected
for (i in 1: length(s)) {
mat = matrix(ncol = 0, nrow = 0)
E = data.frame(mat)
E2 = P2[[i]]
E2 = as.data.frame(E2)
E1 = P1[[i]]
E1 = as.data.frame(E1)
E = cbind(E1, E2)
colnames(E) = c("group1", "group2")
w1 = group1_vectors[i]
w2 = group2_vectors[i]
w3 = gene_vectors[i]
plot1 = ggplot(E, aes(x = group1 , y = group2)) +
geom_point(color='tomato')+
facet_wrap(~w3)
plot1 = ggplotly(plot1)
plot_list_final[[i]] = plot1
}
plot_list_final = do.call(tagList, plot_list_final)
f = length(s)
p_last <- subplot(plot_list_final[1:f], shareX = TRUE, shareY = TRUE)
dev.off()
return(p_last)
})
I would like each subplot has own title