2-factor boxplot (factor 1 by color, factor 2 -separate panels)
Sample Capacity Exercise 2099.5723@0.9192081 575.3566@8.4809475 371.304@7.307821 384.2836@6.331873 1020.6158@7.993983 313.0774@1.0932862 394.1461@1.0290233 465.3097@6.510419 465.2689@7.225454 85.089@1.5650374 387.2975@6.804785 164.0406@1.2928754 2219.5637@0.9156529 921.8011@0.92119545 590.3061@5.517583 535.3677@9.023014 701.8575@0.91474485 281.2716@9.93318 452.1602@7.638591
High_007_bPost_2015-11-23_023-P High bPost 5832 12163 33620 5125 5109 7606 42180 16466 11405 20466 17556 19330 13636 5580 7838 17606 87380 46409 4382
High_010_bPost_2015-11-23_070-P High bPost 5095 5604 50515 3347 16971 6611 13974 5507 14221 17679 4223 11776 5644 6686 14762 78605 4115 5303
High_013_bPost_2015-11-21_048-P High bPost 5816 9955 16012 21578 54734 105610 6579 8512 22192 11870 12837 6066 4115 26377 86221 5735 3119
High_029_bPost_2015-11-24_050-P High bPost 4124 3388 37573 1443 2300 4000 34259 10061 12681 13071 18493 10322 4611 5384 10982 66005 23229 3467
High_030_bPost_2015-11-24_017-P High bPost 4478 5231 5839 13767 7657 81199 3824 15960 4703 2656 11337 5120 1997 12948 72511 2812 4223
High_038_bPost_2015-11-23_101-P High bPost 4702 3302 32197 3854 6776 48215 4678 2509 15019 15843 12162 9814 5589 2011 14031 68532 17360 4218
High_040_bPost_2015-11-21_016-P High bPost 6124 7918 47483 6046 11091 8311 65894 11932 7862 24074 22237 28186 13508 7225 32237 18955 97129 10607 3147
High_043_bPost_2015-11-20_049-P High bPost 7787 7491 63962 11170 109994 23149 4988 23408 24449 35542 18918 8011 1271 22340 128336 19746 3295
High_007_aPre_2015-11-23_006-P High aPre 6096 8872 6025 3620 13078 3252 52029 34257 8343 17281 10944 15557 18065 5211 7104 16215 110718 8816 6117
High_010_aPre_2015-11-23_059-P High aPre 4553 5766 37145 2846 15077 1895 56257 13610 6482 14665 12872 16692 12581 3825 4756 10268 83486 11848 3665
High_013_aPre_2015-11-21_033-P High aPre 4958 9514 2844 20281 66217 178582 5947 24617 19081 6385 16137 4803 2082 29186 101482 23705 3562
High_029_aPre_2015-11-24_037-P High aPre 3557 3262 29482 1802 6132 42841 8316 2155 11097 11653 2739 12382 3537 4555 11427 72349 29354 3439
High_030_aPre_2015-11-24_003-P High aPre 4330 5446 4766 1474 3887 5211 53412 53818 4819 16001 3042 12775 3765 12362 78045 11588 2717
High_038_aPre_2015-11-23_086-P High aPre 4322 3704 23861 2211 10172 42314 4211 4308 17072 12135 10451 3865 2199 11658 82247 50786 4463
High_040_aPre_2015-11-21_007-P High aPre 5690 7082 36134 5265 9883 4362 95534 17698 6878 25207 16315 17123 16785 5102 30605 28895 108496 56735 8063
High_043_aPre_2015-11-20_037-P High aPre 7566 6599 49632 4351 21428 91200 17820 6741 17623 21172 6806 26589 162537 8532 6128
Low_003_bPost_2015-11-24_033-P Low bPost 4835 5811 27007 10220 6368 51819 27179 3594 16864 17207 4196 11440 4549 15033 70052 10257 3863
Low_004_bPost_2015-11-23_054-P Low bPost 4953 8116 29975 3110 8653 5019 50212 36399 2984 22575 20890 21686 13106 4866 2524 14857 85873 17800 4391
Low_006_bPost_2015-11-23_115-P Low bPost 4691 3074 37696 1644 10188 4658 40670 4216 7198 11363 14461 27591 10543 5233 5672 15794 72738 57595 1899
Low_014_bPost_2015-11-20_065-P Low bPost 6092 7966 22000 4094 16174 5232 83061 35154 4629 31937 19001 22720 14885 6646 2135 19761 110629 20104 4003
Low_020_bPost_2015-11-20_032-P Low bPost 9872 3977 44103 5337 7643 6842 111750 8859 15112 15090 24225 24147 9306 3991 20939 171362 20027 6900
Low_027_bPost_2015-11-21_029-P Low bPost 5421 5956 40486 10575 69981 12292 3085 22599 24362 17042 14059 6215 3515 18478 91866 102121 2962
Low_031_bPost_2015-11-23_040-P Low bPost 5639 3428 59658 2304 4304 45651 18225 4294 24381 18913 20314 12777 5641 11492 86228 45742 5135
Low_051_bPost_2015-11-23_082-P Low bPost 4684 3124 28676 2654 3484 2790 56108 36250 1922 18351 13329 8018 11544 4828 3078 11061 78858 10779 5395
Low_003_aPre_2015-11-24_021-P Low aPre 3798 5234 23986 9582 3552 52245 28220 1490 17030 16260 10347 11601 3666 16193 73409 17601 2980
Low_004_aPre_2015-11-23_045-P Low aPre 5410 8138 2950 11129 3796 59214 32204 2788 33743 20523 21205 14895 4332 3994 18574 92849 23568 4414
Low_006_aPre_2015-11-23_106-P Low aPre 3995 3398 25505 4059 2800 4913 6843 11540 16798 13149 3723 4613 9993 77873 10402 3543
Low_014_aPre_2015-11-20_054-P Low aPre 5828 6987 45785 4722 13038 3372 100643 22141 4377 26079 17749 13333 5420 2831 18351 126364 33566 4440
Low_020_aPre_2015-11-20_022-P Low aPre 11293 4472 35678 4637 15414 4867 98266 8390 21023 10043 20783 30353 9287 4242 58055 213426 381752 20127
Low_027_aPre_2015-11-21_021-P Low aPre 5352 5889 38762 3443 9438 74400 11923 3006 35012 25690 31447 16460 2799 15955 105191 45236 3580
Low_031_aPre_2015-11-23_027-P Low aPre 3408 44644 1425 7887 2069 64915 31656 6339 25815 16965 21452 16012 4766 1305 16803 95955 30200 4555
Low_051_aPre_2015-11-23_075-P Low aPre 4061 2061 20437 2115 6747 2230 60733 6654 1598 17560 10715 13537 11942 4418 2192 9031 79599 46004 5375
setwd("M:/DataAnalysis/_Reports/NO EX ID/Evans-FUEL/Stats")
library(reshape2)
library(ggplot2)
# Read before/after data for boxplot
posdat <- read.delim("BA_NO_B5_DATA.txt", check.names=FALSE)
meltba <- melt(posdat, id.vars = c("Sample","Capacity","Exercise"), variable.name = "Target", value.name = "Area", na.rm = TRUE)
meltbasplit <- split(meltba, meltba$Target)
boxpf <- function(x){
if(nrow(x) > 0){
p <- ggplot(x, aes(as.factor(Exercise), Area, fill = Exercise))+ geom_boxplot() + geom_point() + facet_grid(.~Capacity, scales="free",space="free") + ggtitle(x$Target[[1]])
p
}
}
pdf("Evans_FUEL-BA-boxplot.pdf", onefile = T)
lapply(meltbasplit, boxpf)
dev.off()
# Read before/after data for lineplot
posdat <- read.delim("BA_NO_B5_DATA_SUBJ.txt", check.names=FALSE)
meltba <- melt(posdat, id.vars = c("Sample","Capacity","Exercise", "Subject"), variable.name = "Target", value.name = "Area", na.rm = TRUE)
meltbasplit <- split(meltba, meltba$Target)
linePlot <- function(x){
if(nrow(x) > 0){
p <- ggplot(x, aes(Exercise,Area)) + geom_line(aes(colour=Subject)) + facet_grid(.~Capacity, scales="free",space="free") + ggtitle(x$Target[[1]])
p
}
}
pdf("Evans_FUEL-BA-lineplot.pdf", onefile = T)
lapply(meltbasplit, linePlot)
dev.off()
# Read timecourse data for lineplot
posdat <- read.delim("ALL_NO_B5_DATA_SUBJ_TIME.txt", check.names=FALSE)
meltba <- melt(posdat, id.vars = c("Sample","Subject","Timepoint","Time","Group"), variable.name = "Target", value.name = "Area", na.rm = TRUE)
meltbasplit <- split(meltba, meltba$Target)
linePlot <- function(x){
if(nrow(x) > 0){
p <- ggplot(x, aes(Time,Area)) + geom_line(aes(colour=Subject)) + facet_grid(.~Group, scales="free",space="free") + ggtitle(x$Target[[1]])
p
}
}
pdf("Evans_FUEL-Timecourse-lineplot.pdf", onefile = T)
lapply(meltbasplit, linePlot)
dev.off()