BB <- structure(list(Yearmonth = structure(c(12L, 24L, 1L, 13L, 14L,
3L, 15L, 4L, 16L, 5L, 17L, 6L, 18L, 7L, 19L, 8L, 20L, 9L, 21L,
10L, 22L, 11L, 23L), .Label = c("2006-02", "2006-03", "2006-04",
"2006-05", "2006-06", "2006-07", "2006-08", "2006-09", "2006-10",
"2006-11", "2006-12", "2007-01", "2007-02", "2007-03", "2007-04",
"2007-05", "2007-06", "2007-07", "2007-08", "2007-09", "2007-10",
"2007-11", "2007-12", "2008-01"), class = "factor"), Site = structure(c(3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L), .Label = c("301", "520", "Betty's Branch",
"Butler Creek", "CLYO", "Downstream", "Horse Creek", "IP", "North Augusta",
"Stan's", "Stevens Creek", "Vogtle"), class = "factor"), River.Mile = c(215,

215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
215, 215, 215, 215, 215, 215, 215, 215, 215), Lagrangian = structure(c(1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L), .Label = c("No", "Yes"), class = "factor"),
    EventType = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label =
c("Regular",
    "Stormwater"), class = "factor"), Month = c(1L, 1L, 2L, 2L,
    3L, 4L, 4L, 5L, 5L, 6L, 6L, 7L, 7L, 8L, 8L, 9L, 9L, 10L,
    10L, 11L, 11L, 12L, 12L), Year = c(2007L, 2008L, 2006L, 2007L,
    2007L, 2006L, 2007L, 2006L, 2007L, 2006L, 2007L, 2006L, 2007L,
    2006L, 2007L, 2006L, 2007L, 2006L, 2007L, 2006L, 2007L, 2006L,
    2007L), DCAA = c(87, NA, 95, NA, 96, NA, NA, NA, 93, NA,
    NA, NA, NA, NA, NA, 79, 82, NA, NA, NA, NA, NA, 86), Decachlorobiphenyl
= c(79,
    NA, 65, NA, 83, NA, NA, NA, 74, NA, NA, NA, NA, NA, NA, 93,
    76, NA, NA, NA, NA, NA, 74), Tetrachloro.m.xylene = c(90,
    NA, 86, NA, 83, NA, NA, NA, 96, NA, NA, NA, NA, NA, NA, 95,
    91, NA, NA, NA, NA, NA, 85), Alkalinity = c(15, 13, 12, 14,
    13, 16, 13, 16, 13, 17, 13, 19, 13, 14, 14, 15, 15, 14, 16,
    14, 15, 13, 14), BOD..5.day = c(NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_), Carbonaceous.BOD..5.day = c(NA, NA,
    NA, NA, NA, 0.3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA), Chloride = c(2.6, 2.7, 3, 2.9,
    2.8, 2.6, 2.7, 2.5, 3, 2.4, 2.8, 2.5, 2.7, 2.3, 2.7, 2.5,
    2.7, 3, 2.7, 2.6, 2.8, 2.6, 2.7), COD = c(NA, 8.8, NA, NA,
    NA, 13, NA, NA, 7.9, 5.9, NA, NA, NA, NA, NA, NA, NA, 6.6,
    6.5, NA, NA, NA, 12), Dissolved.Ammonia...N..phenate. = c(NA,
    0.095, NA, NA, 0.072, 0.1, 0.17, 0.11, 0.12, NA, 0.055, NA,
    NA, 0.11, NA, NA, 0.1, 0.15, 0.072, 0.078, 0.073, NA, 0.065
    ), Dissolved.Chloride = c(2.7, 2.7, NA, 2.9, 3.4, 2.6, 2.7,
    2.5, 2.9, 2.5, NA, 2.5, 2.7, 2.5, 2.7, 2.4, 2.7, 2.4, 2.8,
    2.7, 2.8, 2.6, 2.8), Dissolved.Mercury = c(NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, 0.00013, NA, NA, NA,
    NA, NA, NA, NA, NA, NA), Dissolved.Nitrate.Nitrite...N = c(0.092,
    0.16, 0.13, 0.14, 0.16, 1.4, 0.15, 0.18, 0.17, 0.21, 0.17,
    0.2, 0.19, 0.16, 0.18, 0.069, 0.048, 0.022, 0.2, 0.056, 0.068,
    0.082, 0.051), Dissolved.Nitrite...N = c(NA, 0.0097, NA,
    0.015, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0.0046, NA, 0.0051,
    0.0034, NA, 0.009, 0.0066, 0.016, NA, NA), Dissolved.Sulfate = c(2.7,
    3.3, NA, 3, 3, 2.5, 2.8, 1.7, 3.1, 2.1, 0.18, 2.5, 3, 2.3,
    2.9, 2.2, 2.8, 2.3, 2.7, 2.6, 5.8, 2.5, 2.8), DOC = c(2.1,
    2, 2.5, 2.1, 2.8, 2.4, 2.3, 2.3, 3.5, 2.1, 2.8, 2, 2.5, 1.9,
    2.4, 2, 2.2, 2.1, 2.2, 2.9, 2.2, 2.6, 2.2), Hardness..total. = c(NA,
    NA, 9.6, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA), Mercury = c(NA, NA, 9.1e-05,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA), Ortho.phosphorus = c(NA, NA, 0.057,
    0.008, 0.016, 0.009, 0.028, 0.04, 0.039, 0.044, 0.01, 0.038,
    NA, 0.089, NA, 0.046, 0.023, 0.019, 0.03, 0.074, NA, 0.027,
    NA), Phosphorus = c(NA, 0.011, 0.042, 0.013, 0.0092, 0.015,
    0.0085, 0.0057, 0.01, 0.01, 0.0068, 0.0099, 0.0073, 0.0085,
    0.008, 0.0072, 0.01, NA, 0.0086, NA, 0.014, 0.011, 0.011),
    Silica..calculation. = c(NA, NA, 9.4, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA
    ), Sulfate = c(2.5, 2.3, 2.5, 2.7, 3, 0.26, 2.9, 2.4, 3.5,
    2.4, 3.1, 2.4, 3.1, 2.2, 3, 2.5, 2.8, 2.4, 2.6, 4.1, 2.8,
    2.4, 3.4), TDS = c(38, NA, 21, 25, 46, 32, 46, 38, 27, 34,
    64, 39, 57, 24, 33, NA, 39, 37, 40, 29, 44, 32, 28), TIC = c(1.1,
    3.6, 1.2, 0.99, 1.6, 3.4, 2.4, 4.6, 1.2, 2.7, 2.2, 0.73,
    3.5, 1.9, 1.6, 2.2, 2.3, 2.4, 2, 2.2, 0.78, 2, 3.8), TKN = c(0.86,
    0.42, 0.42, 0.17, 0.12, 0.2, NA, 0.32, 0.2, 0.46, 0.24, NA,
    0.35, 0.2, 0.37, 0.54, 0.2, 0.18, 0.1, 0.25, NA, NA, 0.39
    ), TOC = c(2, 1.9, 2.2, 2, 2.3, 2.2, 2.3, 2.4, 2.8, 2.2,
    2.6, 1.8, 2.7, 2.2, 2.2, 2, 2.2, 1.9, 2.5, 2, 2.2, 2, 2.1
    ), TSS = c(0.8, 5.7, NA, 1, 1.8, NA, 1.4, NA, 1.1, NA, 8,
    0.6, 1.3, 0.77, 0.5, 1.1, 1, 1.3, 0.8, 1.1, 2.6, 0.4, 0.8
    ), TVSS = c(NA, NA, NA, NA, NA, 3.3, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), pH = c(6.28,
    7.11, 7.2, 6.6, 7.46, 6.5, 6.31, 6.63, 6.2, 6.87, 6.88, 6.68,
    6.78, 6.61, 6.32, 6.96, 6.5, 6.92, 7.06, 6.84, 6.82, 7.51,
    7.16), X2.4.5.T = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), X2.4.5.TP..Silvex.
= c(NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA), X2.4.D = c(NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_), X2.4.DB = c(NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA), X4.4..DDD = c(NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_), X4.4..DDE = c(NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA), X4.4..DDT = c(NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
    Aldrin = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), alpha.BHC = c(NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_), alpha.Chlordane = c(NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA), Aluminum = c(0.034, 0.068, NA,
    0.0091, 0.083, NA, 0.04, NA, 0.04, NA, NA, NA, 0.0094, NA,
    NA, NA, 0.087, NA, NA, NA, 0.016, NA, 0.032), Aroclor.1016 = c(NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA), Aroclor.1221 = c(NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA), Aroclor.1232 = c(NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA), Aroclor.1242 = c(NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA), Aroclor.1248 = c(NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
    Aroclor.1254 = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), Aroclor.1260 =
c(NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA), Arsenic = c(NA, NA, NA, NA,
    NA, NA, 0.00046, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, 0.00034, NA, NA), beta.BHC = c(NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_), Cadmium = c(NA, NA, 8.1e-05,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0.0031, NA, NA, NA,
    NA, NA, NA, NA, NA, NA), Calcium = c(1.6, 2.5, 1.9, 1.8,
    2, 2.8, 2, 1.9, 2.3, 1.9, 2.3, 2, 2.4, 4.3, 2.4, 2.1, 2.3,
    1.8, 2.4, 1.5, 2.3, 1.6, 2.4), Chromium = c(NA, 0.0072, NA,
    0.00036, NA, NA, 0.00092, NA, 8e-04, NA, 0.0011, NA, 0.0013,
    0.00039, 0.00078, 0.00064, NA, NA, 0.00043, NA, NA, NA, NA
    ), Cobalt = c(NA, NA, 7.3e-05, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), Copper = c(0.0012,
    0.0012, NA, 0.00069, 7e-04, 0.005, 0.00084, 0.0017, 0.0012,
    0.0019, 0.00067, 0.0013, 0.0014, 0.0099, 0.001, 0.0011, 0.00092,
    9e-04, 6e-04, NA, 0.00067, 0.00081, 0.00084), Dalapon = c(NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_), delta.BHC = c(NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_), Dicamba = c(NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA), Dichloroprop = c(NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA), Dieldrin = c(NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_), Dinoseb = c(NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_), Dissolved.Aluminum = c(0.017, NA, NA,
    NA, 0.06, NA, 0.0097, NA, 0.027, NA, NA, NA, NA, NA, NA,
    NA, 0.085, NA, NA, NA, 0.034, NA, NA), Dissolved.Arsenic = c(NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_), Dissolved.Cadmium = c(NA,
    NA, NA, NA, NA, 0.00016, NA, 4.2e-05, NA, NA, NA, NA, NA,
    0.00079, 4.7e-05, NA, NA, NA, NA, NA, NA, NA, NA), Dissolved.Calcium =
c(1.7,
    2.4, NA, 1.8, 2, 2.3, 2, 1.9, 2.3, 2, 2.3, 2, 2.5, 2.1, 2.4,
    2.1, 2.3, 1.8, 2.4, 1.5, 2.2, 1.6, 2.4), Dissolved.Chromium = c(NA,
    0.0012, NA, NA, NA, NA, 0.00068, NA, 0.00078, NA, 0.0012,
    NA, 0.001, NA, 0.00072, 0.00049, NA, NA, 0.00046, 0.00037,
    0.00038, NA, NA), Dissolved.Copper = c(0.002, 0.00097, NA,
    0.00087, 0.00084, 0.0024, 0.00089, 0.00083, 0.0012, 0.0011,
    0.00058, 0.0011, 0.001, 0.015, 0.0012, 0.00099, 0.00091,
    0.00084, 0.00066, NA, 0.00064, 9e-04, 0.00095), Dissolved.Iron =
c(0.033,
    0.019, NA, 0.033, 0.047, 0.059, 0.041, NA, 0.032, 0.016,
    0.037, 0.0062, 0.023, 0.011, 0.0096, 0.026, 0.038, 0.015,
    0.11, NA, 0.029, 0.016, 0.028), Dissolved.Lead = c(1e-04,
    NA, NA, 6.2e-05, NA, NA, 3.2e-05, 2e-05, 4.7e-05, NA, 2.1e-05,
    NA, 2.2e-05, 6.2e-05, 2.7e-05, 1.8e-05, NA, 4.3e-05, NA,
    NA, NA, NA, 1.7e-05), Dissolved.Magnesium = c(1.3, 1.3, NA,
    1.2, 1.3, 1.4, 1.2, 1.2, 1.4, 1.2, 1.4, 1.1, 1.5, 1.3, 1.3,
    1.3, 1.3, 1.4, 1.3, 1.3, 1.3, 1.3, 1.6), Dissolved.Manganese = c(0.012,
    0.014, NA, 0.0056, 0.0062, 0.017, 0.0048, 0.0071, 0.0094,
    0.016, 0.012, 0.012, 0.015, 0.048, 0.015, 0.42, 0.29, 0.19,
    0.48, 0.0026, 0.19, 0.0078, 0.0028), Dissolved.Nickel = c(0.00057,
    0.00042, NA, NA, 0.00034, 0.00033, NA, NA, 0.00047, NA, NA,
    NA, NA, NA, 0.00037, 0.00044, NA, NA, NA, NA, 0.00032, NA,
    3e-04), Dissolved.Potassium = c(2.6, 2.2, NA, 1.6, 2.7, 2.6,
    2.6, 2.3, 3.2, 2.1, 2.6, 2.1, 1.4, 2.4, 2.2, 2.6, 1.4, 2.5,
    2.6, 2.5, 2.2, 2.5, 2.4), Dissolved.Selenium = c(0.00034,
    0.00078, NA, NA, NA, NA, NA, 0.00028, NA, NA, NA, NA, NA,
    0.00027, NA, 0.00056, NA, 0.00031, NA, NA, 0.00032, NA, NA
    ), Dissolved.Silicon = c(4.8, 4.3, NA, 4.2, 5, 4.4, 4.8,
    4.1, 5, 4.4, 4.6, 3.9, 4.7, 4.6, 4, 4.2, 4.1, 4.6, 4.2, 4,
    4.2, 4.5, 4.3), Dissolved.Sodium = c(2.8, 3, NA, 2.7, 3,
    3.6, 2.8, 3.3, 3.8, 2.9, 2.9, 2.8, 2, 3.5, 3.8, 2.8, 4, 2.7,
    3.7, 2.8, 2.5, 2.8, 2.7), Dissolved.Zinc = c(0.006, 0.0026,
    NA, 0.016, 0.0053, 0.0077, 0.0042, 0.0041, 0.0069, 0.0078,
    0.0039, 0.0088, 0.003, 0.01, 0.0049, 0.0082, 0.0047, 0.0056,
    0.0043, NA, 0.0044, 0.004, 0.0075), Endosulfan.I = c(NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA), Endosulfan.II = c(NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA), Endosulfan.sulfate = c(NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA), Endrin = c(NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA
    ), Endrin.aldehyde = c(NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
    Endrin.ketone = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), gamma.BHC..Lindane.
= c(NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA), gamma.Chlordane = c(NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA), Heptachlor = c(NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA), Heptachlor.epoxide = c(NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_), Iron = c(0.067, 0.24, 0.022, 0.075,
    0.088, 0.12, 0.088, 0.02, 0.067, 0.037, 0.076, 0.02, 0.05,
    0.029, 0.024, 0.1, 0.15, 0.097, 0.19, 0.051, 0.18, 0.048,
    0.09), Lead = c(NA, 0.00016, 0.00019, 0.00012, NA, NA, NA,
    0.00017, 7.2e-05, 1.6e-05, 5.9e-05, 0.00015, 9e-05, 0.00034,
    NA, 0.00014, NA, 0.00011, 0.00015, NA, NA, 3.5e-05, 7.3e-05
    ), Magnesium = c(1.3, 1.4, 1.2, 1.2, 1.3, 1.5, 1.2, 1.2,
    1.4, 1.3, 1.4, 1.1, 1.5, 1.3, 1.4, 1.3, 1.3, 1.3, 1.4, 1.3,
    1.3, 1.3, 1.6), Manganese = c(0.022, 0.094, 0.0067, 0.02,
    0.012, 0.032, 0.012, 0.013, 0.015, 0.033, 0.022, 0.021, 0.023,
    0.11, 0.038, 0.46, 0.39, 0.24, 0.54, 0.05, 0.48, 0.037, 0.056
    ), MCPA = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), MCPP = c(NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_), Methoxychlor = c(NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_, NA_real_, NA_real_, NA_real_), Nickel = c(0.00087,
    0.0034, 0.0013, 0.00045, 0.00031, 0.00061, NA, NA, NA, 0.00029,
    NA, 0.00032, 0.00036, NA, 0.00031, 0.00053, NA, NA, NA, 5e-04,
    NA, NA, NA), Potassium = c(2.6, 2.3, 1.7, 1.6, 2.7, 3.1,
    2.6, 2.3, 3.2, 2, 2.6, 2.1, 1.7, 2.4, 2.3, 2.6, 1.4, 2.4,
    2.7, 2.5, 2.3, 2.5, 2.4), Selenium = c(0.00048, 0.00047,
    NA, NA, NA, NA, NA, 0.00053, NA, NA, NA, NA, NA, 0.00025,
    NA, 0.00064, NA, NA, NA, NA, 0.00039, 0.00028, NA), Silicon = c(4.8,
    4.7, 4.4, 4.3, 5.1, 4.9, 4.6, 4.3, 4.8, 4.3, 4.7, 4, 4.7,
    4.5, 4.2, 4.1, 4, 4.4, 4.2, 4, 4.2, 4.4, 4.2), Sodium = c(2.8,
    3.2, 3, 2.8, 3, 4.3, 2.8, 3.4, 3.8, 2.8, 2.9, 2.8, 1.9, 3.2,
    3.9, 2.8, 4, 2.6, 3.7, 2.7, 2.4, 2.8, 2.7), Toxaphene = c(NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA), Zinc = c(0.0052, 0.0026, 0.014,
    0.0049, 0.004, 0.011, 0.0031, 0.0028, 0.0036, 0.0053, NA,
    0.0077, 0.0027, 0.0081, 0.0063, 0.005, 0.0018, 0.0041, 0.0017,
    NA, 0.006, 0.0028, 0.0066)), .Names = c("Yearmonth", "Site",
"River.Mile", "Lagrangian", "EventType", "Month", "Year", "DCAA",
"Decachlorobiphenyl", "Tetrachloro.m.xylene", "Alkalinity", "BOD..5.day",
"Carbonaceous.BOD..5.day", "Chloride", "COD",
"Dissolved.Ammonia...N..phenate.",
"Dissolved.Chloride", "Dissolved.Mercury", "Dissolved.Nitrate.Nitrite...N",
"Dissolved.Nitrite...N", "Dissolved.Sulfate", "DOC", "Hardness..total.",
"Mercury", "Ortho.phosphorus", "Phosphorus", "Silica..calculation.",
"Sulfate", "TDS", "TIC", "TKN", "TOC", "TSS", "TVSS", "pH", "X2.4.5.T",
"X2.4.5.TP..Silvex.", "X2.4.D", "X2.4.DB", "X4.4..DDD", "X4.4..DDE",
"X4.4..DDT", "Aldrin", "alpha.BHC", "alpha.Chlordane", "Aluminum",
"Aroclor.1016", "Aroclor.1221", "Aroclor.1232", "Aroclor.1242",
"Aroclor.1248", "Aroclor.1254", "Aroclor.1260", "Arsenic", "beta.BHC",
"Cadmium", "Calcium", "Chromium", "Cobalt", "Copper", "Dalapon",
"delta.BHC", "Dicamba", "Dichloroprop", "Dieldrin", "Dinoseb",
"Dissolved.Aluminum", "Dissolved.Arsenic", "Dissolved.Cadmium",
"Dissolved.Calcium", "Dissolved.Chromium", "Dissolved.Copper",
"Dissolved.Iron", "Dissolved.Lead", "Dissolved.Magnesium",
"Dissolved.Manganese",
"Dissolved.Nickel", "Dissolved.Potassium", "Dissolved.Selenium",
"Dissolved.Silicon", "Dissolved.Sodium", "Dissolved.Zinc", "Endosulfan.I",
"Endosulfan.II", "Endosulfan.sulfate", "Endrin", "Endrin.aldehyde",
"Endrin.ketone", "gamma.BHC..Lindane.", "gamma.Chlordane", "Heptachlor",
"Heptachlor.epoxide", "Iron", "Lead", "Magnesium", "Manganese",
"MCPA", "MCPP", "Methoxychlor", "Nickel", "Potassium", "Selenium",
"Silicon", "Sodium", "Toxaphene", "Zinc"), row.names = c(NA,
23L), class = "data.frame")

#Make zoo object for time series plots
BB.zoo <- zoo(as.matrix(BB), as.yearmon(BB$Yearmonth, format="%Y-%m"))
plot(BB.zoo[, 95], xaxt = "n", ylim=c(1,2))
rng <- range(time(BB.zoo))
axis(1, at = seq(rng[1], rng[2], 1/12), labels = n, tcl = -0.3)

On Wed, Jul 9, 2008 at 9:37 AM, stephen sefick <[EMAIL PROTECTED]> wrote:

> n <-
> c("f","m","a","m","j","j","a","s","o","n","d","j","f","m","a","m","j","j","a","s","o","n","d","j")
> plot(x.zoo[, 95], xaxt = "n", ylim=c(1,2))
> rng <- range(time(x.zoo))
> axis(1, at = seq(rng[1], rng[2], 1/12), labels = n, tcl = -0.3)
>
> #why do I have to put in the y-lim explicitly?  If you try the below code I
> get a warning- Error in plot.window(...) : invalid 'ylim' value
>
> plot(x.zoo[, 95], xaxt = "n")
> rng <- range(time(x.zoo))
> axis(1, at = seq(rng[1], rng[2], 1/12), labels = n, tcl = -0.3)
>
> #thanks Stephen
>
>
> On Tue, Jul 8, 2008 at 4:13 PM, Gabor Grothendieck <
> [EMAIL PROTECTED]> wrote:
>
>> Its a bug in axis.zoo.  I have just fixed it in the svn repository so try
>> this:
>>
>> source("
>> http://r-forge.r-project.org/plugins/scmsvn/viewcvs.php/*checkout*/pkg/R/yearmon.R?rev=485&root=zoo
>> ")
>> plot(x.zoo[, 25])
>>
>> axis.zoo uses the same algorithm as axis.Date in R and so it gives
>> similar results:
>>
>> # uses axis.Date
>> plot(aggregate(x.zoo[, 25], as.Date, force))
>>
>> You may wish to try a custom axis:
>>
>> plot(x.zoo[, 25], xaxt = "n")
>> rng <- range(time(x.zoo))
>> axis(1, at = seq(rng[1], rng[2], 1/12), labels = FALSE, tcl = -0.3)
>> axis(1, at = seq(floor(rng[1]), floor(rng[2])))
>>
>>
>>
>> On Tue, Jul 8, 2008 at 3:34 PM, stephen sefick <[EMAIL PROTECTED]> wrote:
>> > That worked fine- now one more question-
>> > plot(x.zoo[,25])
>> > produces a graph with True as the first label on the x-axis
>> > 1. why?
>> > 2. is it wrong to assume this is february 2006?
>> >
>> > thanks
>> >
>> > stephen
>> > R2.7.1 Windows XP (I updated zoo last week when I installed 2.7.1)
>> >
>> > On Tue, Jul 8, 2008 at 3:17 PM, Gabor Grothendieck <
>> [EMAIL PROTECTED]>
>> > wrote:
>> >>
>> >> On Tue, Jul 8, 2008 at 2:59 PM, stephen sefick <[EMAIL PROTECTED]>
>> wrote:
>> >> > x.zoo <- zoo(x,as.yearmon(as.character(x$Yearmonth), "%Y-%m"))
>> >> > plot(x.zoo[,25])
>> >>
>> >>
>> >> 1. You are trying to pass data frame to zoo whereas it must be a
>> numeric
>> >> vector,
>> >> matrix or a factor.  See ?zoo and try this:
>> >>
>> >> x.zoo <- zoo(data.matrix(x), as.yearmon(x$Yearmonth, format = "%Y-%m"))
>> >>
>> >> 2. You don't need as.character (it won't hurt but its unnecessary)
>> since
>> >> as.yearmon has a factor method.   You only need as.character in the
>> >> situation cited in the last post.
>> >>
>> >>
>> >> >
>> >> > #Error in plot.window(...) : invalid 'ylim' value
>> >> > #there are values
>> >> >
>> >> > On Tue, Jul 8, 2008 at 2:55 PM, Gabor Grothendieck
>> >> > <[EMAIL PROTECTED]>
>> >> > wrote:
>> >> >>
>> >> >> On Tue, Jul 8, 2008 at 2:43 PM, Gabor Grothendieck
>> >> >> <[EMAIL PROTECTED]> wrote:
>> >> >> > There is no data in your data frame, just index info, so I assume
>> you
>> >> >> > want a zero width time series:
>> >> >> >
>> >> >> > zoo(, as.yearmon(x$Yearmonth, "%Y-%m"))
>> >> >> >
>> >> >> > This also works but then you are left with a character date which
>> you
>> >> >> > may not want:
>> >> >> >
>> >> >> > zoo(, x$Yearmonth)
>> >> >>
>> >> >> This last one should have been:
>> >> >>
>> >> >> zoo(, as.character(x$Yearmon))
>> >> >>
>> >> >> since your data frame holds a factor rather than character column.
>> >> >>
>> >> >>
>> >> >> >
>> >> >> >
>> >> >> > On Tue, Jul 8, 2008 at 1:43 PM, stephen sefick <[EMAIL PROTECTED]
>> >
>> >> >> > wrote:
>> >> >> >> #this is a subset of a larger data frame and I am okay with
>> >> >> >> subsetting
>> >> >> >> it as
>> >> >> >> there are redundant time stamps, but I would like to create a zoo
>> >> >> >> object out
>> >> >> >> of this and I am having a hard #time figuring out how to do this
>> >> >> >>  the
>> >> >> >> date
>> >> >> >> structure is  year and then month
>> >> >> >>
>> >> >> >> x <- structure(list(Yearmonth = structure(c(12L, 24L, 1L, 13L,
>> 14L,
>> >> >> >> 3L, 15L, 4L, 16L, 5L, 17L, 6L, 18L, 7L, 19L, 8L, 20L, 9L, 21L,
>> >> >> >> 10L, 22L, 11L, 23L), .Label = c("2006-02", "2006-03", "2006-04",
>> >> >> >> "2006-05", "2006-06", "2006-07", "2006-08", "2006-09", "2006-10",
>> >> >> >> "2006-11", "2006-12", "2007-01", "2007-02", "2007-03", "2007-04",
>> >> >> >> "2007-05", "2007-06", "2007-07", "2007-08", "2007-09", "2007-10",
>> >> >> >> "2007-11", "2007-12", "2008-01"), class = "factor"), Month =
>> c(1L,
>> >> >> >> 1L, 2L, 2L, 3L, 4L, 4L, 5L, 5L, 6L, 6L, 7L, 7L, 8L, 8L, 9L, 9L,
>> >> >> >> 10L, 10L, 11L, 11L, 12L, 12L)), .Names = c("Yearmonth", "Month"
>> >> >> >> ), class = "data.frame", row.names = c(NA, 23L))
>> >> >> >>
>> >> >> >> #thanks Stephen
>> >> >> >>
>> >> >> >> --
>> >> >> >> Let's not spend our time and resources thinking about things that
>> >> >> >> are
>> >> >> >> so
>> >> >> >> little or so large that all they really do for us is puff us up
>> and
>> >> >> >> make us
>> >> >> >> feel like gods. We are mammals, and have not exhausted the
>> annoying
>> >> >> >> little
>> >> >> >> problems of being mammals.
>> >> >> >>
>> >> >> >> -K. Mullis
>> >> >> >>
>> >> >> >>        [[alternative HTML version deleted]]
>> >> >> >>
>> >> >> >> ______________________________________________
>> >> >> >> 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.
>> >> >> >>
>> >> >> >
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Let's not spend our time and resources thinking about things that are
>> so
>> >> > little or so large that all they really do for us is puff us up and
>> make
>> >> > us
>> >> > feel like gods. We are mammals, and have not exhausted the annoying
>> >> > little
>> >> > problems of being mammals.
>> >> >
>> >> > -K. Mullis
>> >
>> >
>> >
>> > --
>> > Let's not spend our time and resources thinking about things that are so
>> > little or so large that all they really do for us is puff us up and make
>> us
>> > feel like gods. We are mammals, and have not exhausted the annoying
>> little
>> > problems of being mammals.
>> >
>> > -K. Mullis
>>
>
>
>
> --
> Let's not spend our time and resources thinking about things that are so
> little or so large that all they really do for us is puff us up and make us
> feel like gods. We are mammals, and have not exhausted the annoying little
> problems of being mammals.
>
> -K. Mullis
>



-- 
Let's not spend our time and resources thinking about things that are so
little or so large that all they really do for us is puff us up and make us
feel like gods. We are mammals, and have not exhausted the annoying little
problems of being mammals.

-K. Mullis

        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to