restructure data table based on date and other categorical variables
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a data table with 4 variables: d18O (water chemistry measurement), Site, Date and Depth
Site, Date and Depth are all categorical. d18O is the data.
I'm wondering if there is an efficient way to compare d18O collected from the same site, on the same date, at DIFFERENT depths. Some dates do not include d18O collected from multiple depths at the same site, but many do.
I'm completely at a loss of how to code this. I've been doing it manually in excel, but my actual dataset is much larger than what I've attached here and it's extremely inefficient.
Any ideas greatly appreciated.
0 Kommentare
Akzeptierte Antwort
Voss
am 24 Okt. 2023
T = readtable('data_test.csv')
T_summary = groupsummary(T,{'Site','Date'},@(x){x},{'d18O','Depth'});
T_summary = removevars(T_summary,'GroupCount');
T_summary = renamevars(T_summary,{'fun1_d18O','fun1_Depth'},{'d18O','Depth'})
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Tables finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!