Revision 75b4e894
Added by Benoit Parmentier almost 9 years ago
climate/research/oregon/interpolation/global_run_scalingup_assessment_part2.R | ||
---|---|---|
5 | 5 |
#Analyses, figures, tables and data are also produced in the script. |
6 | 6 |
#AUTHOR: Benoit Parmentier |
7 | 7 |
#CREATED ON: 03/23/2014 |
8 |
#MODIFIED ON: 02/03/2016
|
|
8 |
#MODIFIED ON: 02/07/2016
|
|
9 | 9 |
#Version: 5 |
10 | 10 |
#PROJECT: Environmental Layers project |
11 | 11 |
#COMMENTS: analyses for run 10 global analyses,all regions 1500x4500km with additional tiles to increase overlap |
... | ... | |
196 | 196 |
tb_month_s <- read.table(file.path(in_dir,basename(df_assessment_files$files[3])),sep=",") |
197 | 197 |
pred_data_month_info <- read.table(file.path(in_dir, basename(df_assessment_files$files[10])),sep=",") |
198 | 198 |
pred_data_day_info <- read.table(file.path(in_dir, basename(df_assessment_files$files[11])),sep=",") |
199 |
df_tile_processed <- read.table(file.path(in_dir, basename(df_assessment_files$files[12])),sep=",") |
|
199 |
df_tile_processed <- read.table(file.path(in_dir, basename(df_assessment_files$files[12])),stringsAsFactors=F,sep=",")
|
|
200 | 200 |
|
201 |
##Screen for non shapefiles tiles due to dir |
|
202 |
df_tile_processed <- df_tile_processed[!is.na(df_tile_processed$shp_files),] |
|
201 | 203 |
#add column for tile size later on!!! |
202 | 204 |
|
203 | 205 |
tb$pred_mod <- as.character(tb$pred_mod) |
... | ... | |
308 | 310 |
png(filename=paste("Figure1_tile_processed_region_",region_name,"_",out_suffix,".png",sep=""), |
309 | 311 |
width=col_mfrow*res_pix,height=row_mfrow*res_pix) |
310 | 312 |
|
311 |
plot(reg_layer) |
|
313 |
plot(reg_layer,border="black",usePolypath = FALSE)
|
|
312 | 314 |
#Add polygon tiles... |
313 | 315 |
for(i in 1:length(shps_tiles)){ |
314 | 316 |
shp1 <- shps_tiles[[i]] |
... | ... | |
635 | 637 |
as.character(unique(test$tile_id)) #141 tiles |
636 | 638 |
|
637 | 639 |
dim(subset(test,test$predicted==365 & test$pred_mod=="mod1")) |
638 |
histogram(subset(test, test$pred_mod=="mod1")$predicted) |
|
640 |
#histogram(subset(test, test$pred_mod=="mod1")$predicted)
|
|
639 | 641 |
unique(subset(test, test$pred_mod=="mod1")$predicted) |
640 | 642 |
table((subset(test, test$pred_mod=="mod1")$predicted)) |
641 | 643 |
|
... | ... | |
678 | 680 |
col_mfrow <- 1 |
679 | 681 |
row_mfrow <- 1 |
680 | 682 |
|
681 |
png(filename=paste("Figure8a_boxplot_overall_separated_by_region_with_oultiers_",out_suffix,".png",sep=""), |
|
683 |
fig_filename <- paste("Figure8a_boxplot_overall_separated_by_region_with_oultiers_",out_suffix,".png",sep="") |
|
684 |
png(filename=fig_filename, |
|
682 | 685 |
width=col_mfrow*res_pix,height=row_mfrow*res_pix) |
683 | 686 |
|
684 | 687 |
p<- bwplot(rmse~pred_mod | reg, data=tb, |
... | ... | |
686 | 689 |
print(p) |
687 | 690 |
dev.off() |
688 | 691 |
|
689 |
list_outfiles[[counter_fig+1]] <- paste("Figure8a_boxplot_overall_accuracy_by_model_separated_by_region_with_oultiers_",out_suffix,".png",sep="")
|
|
692 |
list_outfiles[[counter_fig+1]] <- fig_filename
|
|
690 | 693 |
counter_fig <- counter_fig + 1 |
691 | 694 |
|
692 | 695 |
## Figure 8b |
693 |
png(filename=paste("Figure8b_boxplot_overall_separated_by_region_scaling_",out_suffix,".png",sep=""), |
|
696 |
fig_filename <- paste("Figure8b_boxplot_overall_separated_by_region_scaling_",out_suffix,".png",sep="") |
|
697 |
png(filename=fig_filename, |
|
694 | 698 |
width=col_mfrow*res_pix,height=row_mfrow*res_pix) |
695 | 699 |
|
696 | 700 |
#boxplot(rmse~pred_mod,data=tb,ylim=c(0,5),outline=FALSE)#,names=tb$pred_mod) |
... | ... | |
700 | 704 |
print(p) |
701 | 705 |
dev.off() |
702 | 706 |
|
703 |
list_outfiles[[counter_fig+1]] <- paste("Figure8b_boxplot_overall_accuracy_by_model_separated_by_region_scaling_",out_suffix,".png",sep="")
|
|
707 |
list_outfiles[[counter_fig+1]] <- fig_filename
|
|
704 | 708 |
counter_fig <- counter_fig + 1 |
705 | 709 |
|
706 | 710 |
|
... | ... | |
748 | 752 |
|
749 | 753 |
} |
750 | 754 |
|
751 |
r22 <-c("figure 8c","Boxplot overall accuracy separated by region with outliers","mod1",metric_name,region_name,year_predicted,list_outfiles[[20]])
|
|
752 |
r23 <-c("figure 8d","Boxplot overall accuracy separated by region with scaling","mod1",metric_name,region_name,year_predicted,list_outfiles[[21]])
|
|
753 |
r24 <-c("figure 8c","Boxplot overall accuracy separated by region with outliers","mod_kr",metric_name,region_name,year_predicted,list_outfiles[[20]])
|
|
754 |
r25 <-c("figure 8d","Boxplot overall accuracy separated by region with scaling","mod_kr",metric_name,region_name,year_predicted,list_outfiles[[21]])
|
|
755 |
r22 <-c("figure 8c","Boxplot overall accuracy separated by region with outliers","mod1",metric_name,region_name,year_predicted,list_outfiles[[22]])
|
|
756 |
r23 <-c("figure 8d","Boxplot overall accuracy separated by region with scaling","mod1",metric_name,region_name,year_predicted,list_outfiles[[23]])
|
|
757 |
r24 <-c("figure 8c","Boxplot overall accuracy separated by region with outliers","mod_kr",metric_name,region_name,year_predicted,list_outfiles[[24]])
|
|
758 |
r25 <-c("figure 8d","Boxplot overall accuracy separated by region with scaling","mod_kr",metric_name,region_name,year_predicted,list_outfiles[[25]])
|
|
755 | 759 |
|
756 | 760 |
##################################################### |
757 | 761 |
#### Figure 9: plotting boxplot by year and regions ########### |
Also available in: Unified diff
adding figures 8 related to summary of accuracy