diff --git a/R/2.functional_diversity_metrics.R b/R/2.functional_diversity_metrics.R index e16a1bd..4e45358 100644 --- a/R/2.functional_diversity_metrics.R +++ b/R/2.functional_diversity_metrics.R @@ -236,21 +236,30 @@ ggplot(aes(x = Region, y= `Frequency (%)` , fill= Relationship))+ geom_bar(stat= "identity") + geom_text(aes(label=n), vjust=-0.2, hjust=0.5, position=position_stack(vjust=0), colour="black", size=10)+themes+scale_x_discrete(limits=rev)+ scale_fill_manual(values = c("#AA4499","#888888","#44AA99"),guide = guide_legend( direction = "horizontal", title.position = "top",title.hjust = 0.5))+ - labs(x = "", y = "Frequency (%)", title = "Relationship between functional diversity and productivity \n across different regions") + labs(x = "", y = "Frequency (%)", title = "Relationship between functional diversity and productivity \n across different regions")+ + theme(legend.title = element_text(size=16), #change legend title font size + legend.text = element_text(size=16), + axis.text=element_text(size=16)) p2 = region_prod %>% ggplot(aes(x = Region, y= `Frequency (%)` , fill= Relationship))+ geom_bar(stat= "identity") + geom_text(aes(label=n), vjust=-0.2, hjust=0.5, position=position_stack(vjust=0), colour="black", size=10)+themes+scale_x_discrete(limits=rev)+ scale_fill_manual(values = c("#AA4499","#888888","#44AA99"),guide = guide_legend( direction = "horizontal", title.position = "top",title.hjust = 0.5))+ - labs(x = "", y = "Frequency (%)", title = "Relationship between functional diversity and productivity \n across different regions (rate only)") + labs(x = "", y = "Frequency (%)", title = "Relationship between functional diversity and productivity \n across different regions (rate only)") + + theme(legend.title = element_text(size=16), #change legend title font size + legend.text = element_text(size=16), + axis.text=element_text(size=16)) p3 = region_stock %>% ggplot(aes(x = Region, y= `Frequency (%)` , fill= Relationship))+ geom_bar(stat= "identity") + geom_text(aes(label=n), vjust=-0.2, hjust=0.5, position=position_stack(vjust=0), colour="black", size=10)+themes+scale_x_discrete(limits=rev)+ scale_fill_manual(values = c("#AA4499","#888888","#44AA99"),guide = guide_legend( direction = "horizontal", title.position = "top",title.hjust = 0.5))+ - labs(x = "", y = "Frequency (%)", title = "Relationship between functional diversity and productivity \n across different regions (stock only)") + labs(x = "", y = "Frequency (%)", title = "Relationship between functional diversity and productivity \n across different regions (stock only)")+ + theme(legend.title = element_text(size=16), #change legend title font size + legend.text = element_text(size=16), + axis.text=element_text(size=16)) #p1 = total #p2 = temporal @@ -267,19 +276,28 @@ p1 = ecosys_all %>% geom_bar(stat= "identity") + geom_text(aes(label=n), vjust=-0.2, hjust=0.5, position=position_stack(vjust=0), colour="black", size=10)+themes+scale_x_discrete(limits=rev)+ scale_fill_manual(values = c("#AA4499","#888888","#44AA99"),guide = guide_legend( direction = "horizontal", title.position = "top",title.hjust = 0.5))+ - labs(x = "", y = "Frequency (%)", title = "Relationship between functional diversity and productivity \n across different ecosystems") + labs(x = "", y = "Frequency (%)", title = "Relationship between functional diversity and productivity \n across different ecosystems")+ + theme(legend.title = element_text(size=16), #change legend title font size + legend.text = element_text(size=16), + axis.text=element_text(size=16)) p2 = ecosys_prod %>% ggplot(aes(x = Ecosystem, y= `Frequency (%)` , fill= Relationship))+ geom_bar(stat= "identity") + geom_text(aes(label=n), vjust=-0.2, hjust=0.5, position=position_stack(vjust=0), colour="black", size=10)+themes+scale_x_discrete(limits=rev)+ scale_fill_manual(values = c("#AA4499","#888888","#44AA99"),guide = guide_legend( direction = "horizontal", title.position = "top",title.hjust = 0.5))+ - labs(x = "", y = "Frequency (%)", title = "Relationship between functional diversity and productivity \n across different ecosystems (rate only)") + labs(x = "", y = "Frequency (%)", title = "Relationship between functional diversity and productivity \n across different ecosystems (rate only)") + + theme(legend.title = element_text(size=16), #change legend title font size + legend.text = element_text(size=16), + axis.text=element_text(size=16)) p3 = ecosys_stock %>% ggplot(aes(x = Ecosystem, y= `Frequency (%)` , fill= Relationship))+ geom_bar(stat= "identity") + geom_text(aes(label=n), vjust=-0.2, hjust=0.5, position=position_stack(vjust=0), colour="black", size=10)+themes+scale_x_discrete(limits=rev)+ scale_fill_manual(values = c("#AA4499","#888888","#44AA99"),guide = guide_legend( direction = "horizontal", title.position = "top",title.hjust = 0.5))+ - labs(x = "", y = "Frequency (%)", title = "Relationship between functional diversity and productivity \n across different ecosystems (stock only)") + labs(x = "", y = "Frequency (%)", title = "Relationship between functional diversity and productivity \n across different ecosystems (stock only)")+ + theme(legend.title = element_text(size=16), #change legend title font size + legend.text = element_text(size=16), + axis.text=element_text(size=16)) #p1 = total #p2 = temporal #p3 = stock diff --git a/R/3.mass_ratio_metrics.R b/R/3.mass_ratio_metrics.R index c4fe8ae..d35b103 100644 --- a/R/3.mass_ratio_metrics.R +++ b/R/3.mass_ratio_metrics.R @@ -260,19 +260,27 @@ ecosystem <- bind_rows(grass,fores) %>% mutate(frequencia = replace(frequencia, frequencia == "44" , "45"))%>% mutate(frequencia = replace(frequencia, frequencia == "62" , "63"))%>% mutate(frequencia = replace(frequencia, frequencia == "23" , "22"))%>% - mutate(frequencia = as.numeric(frequencia)) - + mutate(frequencia = as.numeric(frequencia)) %>% + mutate(ecosystem = replace(ecosystem, ecosystem == "Forest" , "F")) %>% + mutate(ecosystem = replace(ecosystem, ecosystem == "Grassland" , "G"))%>% + mutate(Variables = replace(Variables, Variables == "Root quantity" , "Root")) ecosystem_metric_prod <- bind_rows(grass_prod,fores_prod) %>% group_by(Variables, ecosystem,metric) %>% mutate(frequencia = round((`Number of papers`/sum(`Number of papers`) * 100), digits = 0)) %>% - rename(Relationship = Valores) + rename(Relationship = Valores)%>% + mutate(ecosystem = replace(ecosystem, ecosystem == "Forest" , "F")) %>% + mutate(ecosystem = replace(ecosystem, ecosystem == "Grassland" , "G")) %>% + mutate(Variables = replace(Variables, Variables == "Root quantity" , "Root")) ecosystem_metric_stock <- bind_rows(grass_stock,fores_stock) %>% group_by(Variables, ecosystem,metric) %>% mutate(frequencia = round((`Number of papers`/sum(`Number of papers`) * 100), digits = 0)) %>% rename(Relationship = Valores) %>% mutate(frequencia = replace(frequencia, frequencia == "38" , "37.5"))%>% - mutate(frequencia = as.numeric(frequencia)) + mutate(frequencia = as.numeric(frequencia))%>% + mutate(ecosystem = replace(ecosystem, ecosystem == "Forest" , "F")) %>% + mutate(ecosystem = replace(ecosystem, ecosystem == "Grassland" , "G"))%>% + mutate(Variables = replace(Variables, Variables == "Root quantity" , "Root")) p1 <- ecosystem %>% ggplot(aes(x=ecosystem, y=frequencia, fill=Relationship))+geom_bar(stat= "identity") + @@ -280,7 +288,10 @@ p1 <- ecosystem %>% scale_fill_manual(values = c("#AA4499","#888888","#44AA99"),guide = guide_legend( direction = "horizontal",title.position = "top",title.hjust = 0.5))+ facet_grid(facets = ~(Variables), scales="free") + - geom_text(aes(label=`Number of papers`), vjust=-0.5, hjust=0.5, position=position_stack(vjust=0), colour="black", size=8) + my_theme + geom_text(aes(label=`Number of papers`), vjust=-0.5, hjust=0.5, position=position_stack(vjust=0), colour="black", size=8) + my_theme+ + theme(legend.title = element_text(size=16), #change legend title font size + legend.text = element_text(size=16), + axis.text=element_text(size=16)) p2 <- ecosystem_metric_prod %>% ggplot(aes(x=ecosystem, y=frequencia, fill=Relationship))+geom_bar(stat= "identity") + @@ -288,7 +299,10 @@ p2 <- ecosystem_metric_prod %>% scale_fill_manual(values = c("#AA4499","#888888","#44AA99"),guide = guide_legend( direction = "horizontal",title.position = "top",title.hjust = 0.5))+ facet_grid(facets = ~(Variables), scales="free") + - geom_text(aes(label=`Number of papers`), vjust=-0.5, hjust=0.5, position=position_stack(vjust=0), colour="black", size=8) + my_theme + geom_text(aes(label=`Number of papers`), vjust=-0.5, hjust=0.5, position=position_stack(vjust=0), colour="black", size=8) + my_theme+ + theme(legend.title = element_text(size=16), #change legend title font size + legend.text = element_text(size=16), + axis.text=element_text(size=16)) p3 <- ecosystem_metric_stock %>% ggplot(aes(x=ecosystem, y=frequencia, fill=Relationship))+geom_bar(stat= "identity") + @@ -296,10 +310,13 @@ p3 <- ecosystem_metric_stock %>% scale_fill_manual(values = c("#AA4499","#888888","#44AA99"),guide = guide_legend( direction = "horizontal",title.position = "top",title.hjust = 0.5))+ facet_grid(facets = ~(Variables), scales="free") + - geom_text(aes(label=`Number of papers`), vjust=-0.5, hjust=0.5, position=position_stack(vjust=0), colour="black", size=8) + my_theme + geom_text(aes(label=`Number of papers`), vjust=-0.5, hjust=0.5, position=position_stack(vjust=0), colour="black", size=8) + my_theme+ + theme(legend.title = element_text(size=16), #change legend title font size + legend.text = element_text(size=16), + axis.text=element_text(size=16)) plots = (p1|(p2/p3)) +plot_annotation(tag_levels = c("A"))+ plot_layout(widths = c(1, 1)) -# png('results/CWM_estoque_temporal_ecosystem.png', units="in", width=35, height=12, res=300) +# png('results/CWM_estoque_temporal_ecosystem.png', units="in", width=12, height=10, res=300) # plots # dev.off() @@ -313,21 +330,30 @@ regiao <- bind_rows(temp,trop)%>% mutate(frequencia = replace(frequencia, frequencia == "12" , "13"))%>% mutate(frequencia = replace(frequencia, frequencia == "35" , "35.5"))%>% mutate(frequencia = replace(frequencia, frequencia == "27" , "27.5"))%>% - mutate(frequencia = as.numeric(frequencia)) + mutate(frequencia = as.numeric(frequencia))%>% + mutate(regiao = replace(regiao, regiao == "Temperate" , "Te")) %>% + mutate(regiao = replace(regiao, regiao == "Tropical" , "Tr")) %>% + mutate(Variables = replace(Variables, Variables == "Root quantity" , "Root")) regiao_metric_prod <- bind_rows(temp_prod, trop_prod) %>% group_by(Variables, regiao, metric) %>% mutate(frequencia = round((`Number of papers`/sum(`Number of papers`) * 100), digits = 0)) %>% rename(Relationship = Valores)%>% mutate(frequencia = replace(frequencia, frequencia == "33" , "33.3"))%>% - mutate(frequencia = as.numeric(frequencia)) + mutate(frequencia = as.numeric(frequencia))%>% + mutate(regiao = replace(regiao, regiao == "Temperate" , "Te")) %>% + mutate(regiao = replace(regiao, regiao == "Tropical" , "Tr")) %>% + mutate(Variables = replace(Variables, Variables == "Root quantity" , "Root")) regiao_metric_stock <- bind_rows(temp_stock, trop_stock) %>% group_by(Variables, regiao, metric) %>% mutate(frequencia = round((`Number of papers`/sum(`Number of papers`) * 100), digits = 0)) %>% rename(Relationship = Valores)%>% mutate(frequencia = replace(frequencia, frequencia == "67" , "66"))%>% - mutate(frequencia = as.numeric(frequencia)) + mutate(frequencia = as.numeric(frequencia))%>% + mutate(regiao = replace(regiao, regiao == "Temperate" , "Te")) %>% + mutate(regiao = replace(regiao, regiao == "Tropical" , "Tr")) %>% + mutate(Variables = replace(Variables, Variables == "Root quantity" , "Root")) p1 <- regiao %>% ggplot(aes(x=regiao, y=frequencia, fill=Relationship))+geom_bar(stat= "identity") + @@ -335,7 +361,10 @@ p1 <- regiao %>% scale_fill_manual(values = c("#AA4499","#888888","#44AA99"),guide = guide_legend( direction = "horizontal",title.position = "top",title.hjust = 0.5))+ facet_grid(facets = ~(Variables), scales="free") + - geom_text(aes(label=`Number of papers`), vjust=-0.5, hjust=0.5, position=position_stack(vjust=0), colour="black", size=8) + my_theme + geom_text(aes(label=`Number of papers`), vjust=-0.5, hjust=0.5, position=position_stack(vjust=0), colour="black", size=8) + my_theme+ + theme(legend.title = element_text(size=16), #change legend title font size + legend.text = element_text(size=16), + axis.text=element_text(size=16)) p2 <- regiao_metric_prod %>% ggplot(aes(x=regiao, y=frequencia, fill=Relationship))+geom_bar(stat= "identity") + @@ -343,7 +372,10 @@ p2 <- regiao_metric_prod %>% scale_fill_manual(values = c("#AA4499","#888888","#44AA99"),guide = guide_legend( direction = "horizontal",title.position = "top",title.hjust = 0.5))+ facet_grid(facets = ~(Variables), scales="free") + - geom_text(aes(label=`Number of papers`), vjust=-0.5, hjust=0.5, position=position_stack(vjust=0), colour="black", size=8) + my_theme + geom_text(aes(label=`Number of papers`), vjust=-0.5, hjust=0.5, position=position_stack(vjust=0), colour="black", size=8) + my_theme+ + theme(legend.title = element_text(size=16), #change legend title font size + legend.text = element_text(size=16), + axis.text=element_text(size=16)) p3 <- regiao_metric_stock %>% ggplot(aes(x=regiao, y=frequencia, fill=Relationship))+geom_bar(stat= "identity") + @@ -351,10 +383,13 @@ p3 <- regiao_metric_stock %>% scale_fill_manual(values = c("#AA4499","#888888","#44AA99"),guide = guide_legend( direction = "horizontal",title.position = "top",title.hjust = 0.5))+ facet_grid(facets = ~(Variables), scales="free") + - geom_text(aes(label=`Number of papers`), vjust=-0.5, hjust=0.5, position=position_stack(vjust=0), colour="black", size=8) + my_theme + geom_text(aes(label=`Number of papers`), vjust=-0.5, hjust=0.5, position=position_stack(vjust=0), colour="black", size=8) + my_theme+ + theme(legend.title = element_text(size=16), #change legend title font size + legend.text = element_text(size=16), + axis.text=element_text(size=16)) plots = (p1|(p2/p3)) +plot_annotation(tag_levels = c("A"))+ plot_layout(widths = c(1, 1)) -# png('results/CWM_estoque_temporal_regiao.png', units="in", width=35, height=12, res=300) +# png('results/CWM_estoque_temporal_regiao.png', units="in", width=12, height=10, res=300) # plots # dev.off() diff --git a/R/desktop.ini b/R/desktop.ini index 08242df..ffd862e 100644 --- a/R/desktop.ini +++ b/R/desktop.ini @@ -1,2 +1,2 @@ [.ShellClassInfo] -IconResource=C:\Program Files\Google\Drive File Stream\89.0.2.0\GoogleDriveFS.exe,25 +IconResource=C:\Program Files\Google\Drive File Stream\92.0.0.0\GoogleDriveFS.exe,25 diff --git a/desktop.ini b/desktop.ini index 08242df..ffd862e 100644 --- a/desktop.ini +++ b/desktop.ini @@ -1,2 +1,2 @@ [.ShellClassInfo] -IconResource=C:\Program Files\Google\Drive File Stream\89.0.2.0\GoogleDriveFS.exe,25 +IconResource=C:\Program Files\Google\Drive File Stream\92.0.0.0\GoogleDriveFS.exe,25 diff --git a/processed_data/desktop.ini b/processed_data/desktop.ini index 08242df..ffd862e 100644 --- a/processed_data/desktop.ini +++ b/processed_data/desktop.ini @@ -1,2 +1,2 @@ [.ShellClassInfo] -IconResource=C:\Program Files\Google\Drive File Stream\89.0.2.0\GoogleDriveFS.exe,25 +IconResource=C:\Program Files\Google\Drive File Stream\92.0.0.0\GoogleDriveFS.exe,25 diff --git a/results/CWM_estoque_temporal_ecosystem.png b/results/CWM_estoque_temporal_ecosystem.png index 39f98d0..c487fbf 100644 Binary files a/results/CWM_estoque_temporal_ecosystem.png and b/results/CWM_estoque_temporal_ecosystem.png differ diff --git a/results/CWM_estoque_temporal_regiao.png b/results/CWM_estoque_temporal_regiao.png index f7abaad..960f12d 100644 Binary files a/results/CWM_estoque_temporal_regiao.png and b/results/CWM_estoque_temporal_regiao.png differ diff --git a/results/FDonprod_ecosys.png b/results/FDonprod_ecosys.png index 7d68b0e..aa855b1 100644 Binary files a/results/FDonprod_ecosys.png and b/results/FDonprod_ecosys.png differ diff --git a/results/FDonprod_temptrop.png b/results/FDonprod_temptrop.png index 1ed87c1..36e0aad 100644 Binary files a/results/FDonprod_temptrop.png and b/results/FDonprod_temptrop.png differ diff --git a/results/desktop.ini b/results/desktop.ini index 08242df..ffd862e 100644 --- a/results/desktop.ini +++ b/results/desktop.ini @@ -1,2 +1,2 @@ [.ShellClassInfo] -IconResource=C:\Program Files\Google\Drive File Stream\89.0.2.0\GoogleDriveFS.exe,25 +IconResource=C:\Program Files\Google\Drive File Stream\92.0.0.0\GoogleDriveFS.exe,25