Hi forum I need to add boxplot layers to my ggplot chart depending on a boolean condition (TRUE/FALSE). What's wrong in what I wrote? Thank you
myChart <- ggplot() if (RotIf == TRUE) { myChart = myChart + geom_boxplot(data=fileInRotSubdB, outlier.shape = NA, aes(x=fileInRotSubdB$acq_date, y=fileInRotSubdB$Mean_dB, group=fileInRotSubdB$acq_date), colour ="black", fill="red", width=1)} if (WobIf == TRUE) { myChart = myChart + geom_boxplot(data=fileInWobSub, outlier.shape = NA, aes(x=fileInWobSubdB$acq_date, y=fileInWobSubdB$Mean_dB, group=fileInWobSubdB$acq_date), colour ="black", fill="pink", width=1)} if (BroIf == TRUE) { myChart = myChart + geom_boxplot(data=fileInBroSub, outlier.shape = NA, aes(x=fileInBroSub$acq_date, y=fileInBroSub$Mean_dB, group=fileInBroSub$acq_date), colour ="black", fill="blue", width=1)} -- Sent from: http://r.789695.n4.nabble.com/datatable-help-f2315188.html _______________________________________________ datatable-help mailing list datatable-help@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help