Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Download Nutrient Data (Starting with HUC-08 Lower Mississippi River for documenting steps; will combine sites from other HUCs into one document for trend analysis)
    1. HUC08Data<-readWQPdata(huc="08", characteristicType="Nutrient", siteType="Stream")
    1.  Nitrate plus Nitrite, the CharacteristicName is "Inorganic nitrogen (nitrate and nitrite)"
      1. Remove Composite Samples, field observations and quality control samples (the two types we want are "Sample-Routine" and "Sample")
        1. SampleRoutine<-filter(HUC08Data, ActivityTypeCode == "Sample-Routine" | ActivityTypeCode == "Sample")
      2. Also want to remove preliminary values
        1. ResultStatusIdentifier = "Preliminary"
      3. select parameters to harmonize
        1. Inorganic nitrogen (nitrate and nitrite) ; Inorganic nitrogen (nitrate and nitrite) as N ; Nitrate ; Nitrate as N ;
          1. filter/group by site + date + time 
          2. look to see if "Inorganic nitrogen (nitrate and nitrite)" is available at a particular site. 
            1. If so, is there more than one entry for that date and time at the site?
              1. If yes, keep the data that indicates filtered in column "ResultSampleFractionText"
              2. if no, keep the unfiltered or total
            2. If Inorganic Nitrogen not available, go through the same procedure as above for: Inorganic nitrogen (nitrate and nitrite) as N; Nitrate and Nitrate as N; Nitrate. All can be combined to make a longer record if needed.
          3. Check to see if there are "ResultDetectionConditionText" qualifiers - (Not detected or below detection Limit. .... Figure out what to do with those)
            1. > count(finalResult$ResultDetectionConditionText)

              x freq

              1 *Non-detect 9

              2 *Present <QL 9

              3 Below Detection Limit 6

              4 Detected Not Quantified 7

              5 Not Detected 15050

              6 Not Present 1

              7 Not Reported 11

              8 Present Above Quantification Limit 9

              9 Present Below Quantification Limit 1749

              10 <NA> 15107
          4. Determine if units are as N or NO3, change to "as N" when necessary. Want units to be "mg/l as N" in column "ResultMeasure.MesaureUnitCode"Select Parameter of Interest and Harmonize Data 

...