Skip to content

Commit

Permalink
update display_rpt
Browse files Browse the repository at this point in the history
  • Loading branch information
Sungchan Oh committed Jul 6, 2024
1 parent bf1801d commit 5bbad6f
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions display_variance.r
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()
}





0 comments on commit 5bbad6f

Please sign in to comment.