I am working with a data set of water samples that were tested for the presence of legionella using PCR. I most cases multiple samples were collected from different sites in the same building and all of the rows of the table contain a building ID indicating which building they are from. I am looking to subset the data by building ID, build a new row of data for each subset consisting of the combined stats from all the rows of the subset, and then merge the newly created rows into a new data set. I know I can subset the data by using "by Building_ID" but I am totally lost on creating and merging a new data set from those subsets. For reference my data looks something like this: Sample ID Building ID Facility Type Legionella Present Legionella Load Building Floors 1 1 1 1 500 1 2 1 1 0 0 1 3 2 2 0 0 3 4 3 2 1 6000 5 5 3 2 0 0 5 6 3 2 0 0 5 7 4 1 1 200 2 8 4 1 1 400 2 And I need my output to look something like this: Building ID Legionella Present Legionella Load Max Legionella Load Min Legionella Load Average Building Floors 1 1 500 0 250 1 2 0 0 0 0 3 3 1 6000 0 2000 5 4 1 400 200 300 2
... View more