#pkg library(tidyverse)library(patchwork)library(readxl)# functionsource(here::here("src/function/stat_function/stat_analysis_main.R")) # for make plot source(here::here("src/function/fig_export.R")) # This function saves a given plot (plot_x) as both a PDF and a high-resolution PNG file at specified dimensions.# cosmeticspallet=read_excel(here::here("data/color_palette.xlsm")) %>%filter(set =="edaphic_condition") %>% dplyr::select(color, treatment) %>%pull(color) %>%setNames(read_excel(here::here("data/color_palette.xlsm")) %>%filter(set =="edaphic_condition") %>%pull(treatment) )
3.1 Data importation
Code
# data importationraw_file <-read_excel(here::here("data/physio/biomass/biomass_verif_modif_CM.xlsx"), col_names = T) %>% dplyr::mutate(genotype =case_when( genotype %in%"2684"~"W78*", genotype %in%"4693"~"E568K", genotype %in%"CAM2684"~"WT1", genotype %in%"CAM4693"~"WT2", genotype %in%"KAY"~"KAY"),genotype = forcats::fct_relevel(genotype, "KAY", "WT1", "W78*", "WT2", "E568K"),water_condition = forcats::fct_relevel(water_condition, "WW", "WS"),condition =paste(sep ="_", genotype, sulfur_condition), sulfur_condition = forcats::fct_relevel(sulfur_condition, "SS", "SD"),sampling = forcats::fct_relevel(sampling, "E0", "E1", "E2", "Emat", "ERT"),edaphic_condition =paste(sep ="_", water_condition, sulfur_condition), edaphic_condition = forcats::fct_relevel(edaphic_condition, "WW_SS", "WW_SD", "WS_SS", "WS_SD") )raw_file_v <- raw_file %>%pivot_longer(cols =c(""), names_to ="organ", values_to ="DW")raw_file_v <- raw_file %>%mutate(across(contains("DW"), as.numeric)) %>%pivot_longer(cols =contains("DW"), # toutes les colonnes qui finissent par "DW"names_to ="compartment", # nom de la colonne qui contiendra le nom initialvalues_to ="biomass"# nom de la colonne qui contiendra la valeur )