Actually, this is my code, I have to separate plots (plot1 and plot2), then by "subplot" I merged them.
</>
f1 = da_cell_plot1()
plot1 = ggplot(f1, aes(x = input$celltype1, y = V1, text = paste("Cell type:", input$celltype1,
"\n", "shap value:", V1))) +
geom_jitter(alpha = 0.1, color = "tomato")+
geom_boxplot(alpha = 0)
plot1%>%
ggplotly(tooltip="text")
f2 = da_cell_plot2()
plot2 = ggplot(f2, aes(x = input$celltype2, y = V1, text = paste("Cell type:", input$celltype2,
"\n", "shap value:", V1))) +
geom_jitter(alpha = 0.1, color = "tomato") +
geom_boxplot(alpha = 0)
plot2%>%
ggplotly(tooltip="text")
Final_fig_box <- subplot(plot1, plot2)%>%
layout(title = "Inferred Celltype Activity")
print("it works")
return(Final_fig_box)
</>