restructure data table based on date and other categorical variables
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuesta aceptada
Voss
el 24 de Oct. de 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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Spreadsheets en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!