in script 3 drop records that still have Crop_strategy values null
@slgora Can you add code to drop the records that have still null values of Crop_strategy after assign it? assuming the assign_crop_strategy function now works well, these should be the accessions with Genus that are not in our list of selected crops
insert the new code after this already existing code in script 3:
###### 2. Assign crop strategy categorical variable ######################
#use Assign_crop_strategy.R function in Functions folder
source("Functions/Assign_crop_strategy.R")
combined_df <- combined_df %>% mutate(GENUS_standardized = word(!!sym("Standardized_taxa"), 1)) # Extract the first word (genus)
combined_df = assign_crop_strategy(combined_df, crops = crops, col_name = "GENUS_standardized")
SGSV_allcrops = assign_crop_strategy(SGSV_allcrops, crops = crops, col_name = "GENUS")
GLIS_processed = assign_crop_strategy(GLIS_processed, crops = crops, col_name = "GENUS")
BGCI_processed <- BGCI_processed %>% mutate(GENUS_standardized = word(!!sym("Standardized_taxa"), 1)) # Extract the first word (genus)
BGCI_processed = assign_crop_strategy(BGCI_processed, crops = crops, col_name = "GENUS_standardized")