diff --git a/boxplot_linear.R b/boxplot_linear.R index 5a41b01..ceb200c 100644 --- a/boxplot_linear.R +++ b/boxplot_linear.R @@ -24,6 +24,9 @@ output_boxplot = paste0(outdir_plots, outfile_bp); output_boxplot #=============================== # data assignment for plots #================================ +#----------- +# npa +#----------- #wf_fp_npa = npa_wf[npa_wf$flustat == 1,] lf_fp_npa = npa_lf[npa_lf$flustat == 1,] lf_fp_npa$timepoint = paste0("t", lf_fp_npa$timepoint) @@ -34,7 +37,9 @@ table(lf_fp_npa$mediator) head(lf_fp_npa$value[lf_fp_npa$mediator == "vitd"]) lf_fp_npa = lf_fp_npa[!lf_fp_npa$mediator == "vitd",] - +#----------- +# sam +#----------- #wf_fp_sam = samm_wf[samm_wf$flustat == 1,] lf_fp_sam = sam_lf[sam_lf$flustat == 1,] lf_fp_sam$timepoint = paste0("t", lf_fp_sam$timepoint) @@ -45,7 +50,9 @@ table(lf_fp_sam$mediator) head(lf_fp_sam$value[lf_fp_sam$mediator == "vitd"]) lf_fp_sam = lf_fp_sam[!lf_fp_sam$mediator == "vitd",] - +#----------- +# serum +#----------- #wf_fp_serum = serum_wf[serum_wf$flustat == 1,] lf_fp_serum = serum_lf[serum_lf$flustat == 1,] lf_fp_serum$timepoint = paste0("t", lf_fp_serum$timepoint) @@ -63,7 +70,7 @@ if (is.factor(lf_fp_npa$timepoint) && is.factor(lf_fp_npa$timepoint)){ cat ("PASS: required groups are factors") } #------------------------------------------ -title_npa_linear = "Boxplot: NPA (Linear)" +title_npa_linear = "NPA (Linear)" #----------------------------------------- bxp_npa_linear <- ggboxplot(lf_fp_npa, x = "timepoint", y = "value", color = "obesity", palette = c("#00BFC4", "#F8766D")) + @@ -96,7 +103,7 @@ if (is.factor(lf_fp_sam$timepoint) && is.factor(lf_fp_sam$timepoint)){ } #------------------------------------------ -title_sam_linear = "Boxplot: sam (Linear)" +title_sam_linear = "SAM (Linear)" #----------------------------------------- bxp_sam_linear <- ggboxplot(lf_fp_sam, x = "timepoint", y = "value", color = "obesity", palette = c("#00BFC4", "#F8766D")) + @@ -130,7 +137,7 @@ if (is.factor(lf_fp_serum$timepoint) && is.factor(lf_fp_serum$timepoint)){ table(lf_fp_serum$mediator) #------------------------------------------ -title_serum_linear = "Boxplot: serum (Linear)" +title_serum_linear = "SERUM (Linear)" #----------------------------------------- bxp_serum_linear <- ggboxplot(lf_fp_serum, x = "timepoint", y = "value", color = "obesity", palette = c("#00BFC4", "#F8766D")) +