I have a table that looks like this: measurement date door color 0.93529385 513 open red 0.97419293 420 open red 0.962053514 513 closed red 0.963909937 1230 open blue 0.97652034 1230 open green 0.989310795 1230 closed blue 0.9941022 917 closed yellow
I would like to create a table that has: Open measurement, Closed measurement, date, color. For every date/color combination, there should be two columns to represent the door open/closed measurement. If there are multiple datapoints with a given door/date/color combination, then they should be averaged. I would also like to make two columns to represent the number of datapoints that were averaged in determining the open/closed measurements. Jeffrey ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.