I have a csv file with several variables, and each variable has several modalities, as illustrated below for example:
Region Crop Date Product
a aa aaa aaaa
a dd ddd ssss
b ss eee dddd
b cc fff ffff
c vv fff gggg
c gg ddd rrrr
d ff sss tttt
d rr ggg gggg
and I want to create several folders according to the modalities of the "Region" variable with several .csv files inside according to the modalities of the "crop" variable obtaining folders like in picture regions folders
and inside each folder having files for crops like in the picture crops files
in summary I want to obtain the data by crop by region. I could have the data by crop or by region using the library "tidyverse" but to combine the two "crops files for each region folder" I can't do it if you can help me on it and thank you in advance.