I would like to combine 3 plots(p1+p2+p3) together with conditional plot_layout() to p_all. However I could not get my if statement work. Could anyone guide me on this?
p3 is for sure exist, but p1|p2 might be null. layout_p is number of plot need to be bind.
{if(length(p1@data$Subject)>0) (p1)} +
{if(length(p2@data$Subject)>0) (p2)} +
p3+
{if(layout_p=3) (plot_layout(widths=c(5,5, 50)))}+
{if(layout_p=2) (plot_layout(widths=c(5, 55)))}+
{if(layout_p=1) (plot_layout(widths=c(60)))}
