-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sungchan Oh
committed
Jul 6, 2024
1 parent
bf1801d
commit 5bbad6f
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
library(ggplot2) | ||
|
||
# TODO | ||
# calc rpt without public hybrid | ||
# order hybrid a b c ... | ||
# yaxis label <- variable | ||
|
||
|
||
# Input long format data | ||
|
||
path.rgb.long <- ("./df_rgb_long.csv") | ||
path.hsi.long <- ("./df_hsi_long.csv") | ||
path.rpt <- ("./rpt.csv") | ||
|
||
|
||
|
||
# Load RGB and HSI data in long format | ||
message("Loading data...") | ||
df.rgb <- read.csv(path.rgb.long) | ||
df.hsi <- read.csv(path.hsi.long) | ||
df.rpt <- read.csv(path.rpt) | ||
|
||
# Combine RGB and HSI data | ||
df <- rbind(df.rgb, df.hsi) | ||
|
||
|
||
|
||
# Sort repeatability by desending order | ||
message("Sorting repeatability data...") | ||
df.rpt <- df.rpt[!is.na(df.rpt$repeatability),] | ||
df.rpt.sort <- df.rpt[order(df.rpt$repeatability, decreasing=T), ] | ||
|
||
|
||
|
||
|
||
n <- 10 | ||
for (i in seq(1,10)){ | ||
row <- df.rpt.sort[i,] | ||
df.temp <- df[which(df$TREATMENT==row$TREATMENT & | ||
df$GROWTH_STAGE==row$GROWTH_STAGE & | ||
df$View==row$View & | ||
df$frame_nr==row$frame_nr & | ||
df$variable==row$variable), ] | ||
p = ggplot(df.temp, aes(x=VARIETY, y=value)) + | ||
geom_boxplot() | ||
path.plot <- paste0('./variance_', i, '_', row$TREATMENT, '_', row$GROWTH_STAGE, '_', row$View, '_', row$frame_nr, '_', row$variable, '.png') | ||
png(path.plot) | ||
print(p) | ||
dev.off() | ||
} | ||
|
||
|
||
|
||
|
||
|